(node)
| 14406 | } |
| 14407 | //判断是否是静态的ast虚拟dom type必须不等于2和3,pre必须为真 |
| 14408 | function isStatic(node) { |
| 14409 | if (node.type === 2) { // expression 属性节点 expression |
| 14410 | return false |
| 14411 | } |
| 14412 | if (node.type === 3) { // text 文本节点或者是空注释节点 |
| 14413 | return true |
| 14414 | } |
| 14415 | return !!( |
| 14416 | // 跳过这个元素和它的子元素的编译过程。可以用来显示原始 Mustache 标签。跳过大量没有指令的节点会加快编译。 遇到指令不需要编译成模板显示原始指令 |
| 14417 | node.pre || //标记 标签是否还有 v-pre 指令 ,如果有则为真 |
| 14418 | ( |
| 14419 | !node.hasBindings && // no dynamic bindings // 没有动态标记元素 |
| 14420 | !node.if && !node.for && // not v-if or v-for or v-else 没有 v-if 或者 v-for 或者 v-else |
| 14421 | !isBuiltInTag(node.tag) && // not a built-in 没有 slot,component |
| 14422 | isPlatformReservedTag(node.tag) && // not a component 不是一个组件 保留标签 判断是不是真的是 html 原有的标签 或者svg标签 |
| 14423 | !isDirectChildOfTemplateFor(node) && // 判断当前ast 虚拟dom 的父标签 如果不是template则返回false,如果含有v-for则返回true |
| 14424 | Object.keys(node).every(isStaticKey) //node的key必须每一项都符合 匹配type,tag,attrsList,attrsMap,plain,parent,children,attrs + staticKeys 的字符串 |
| 14425 | ) |
| 14426 | ) |
| 14427 | } |
| 14428 | |
| 14429 | // 判断当前ast 虚拟dom 的父标签 如果不是template则返回false,如果含有v-for则返回true |
| 14430 | function isDirectChildOfTemplateFor(node) { |
no test coverage detected