Răsfoiți Sursa

remove unnecessary v-pre related code

Evan You 10 ani în urmă
părinte
comite
f8cfc81826

+ 0 - 1
flow/vnode.js

@@ -29,7 +29,6 @@ declare interface VNodeWithData {
 }
 
 declare interface VNodeData {
-  pre?: true;
   key?: string | number;
   slot?: string;
   staticClass?: string;

+ 0 - 4
src/compiler/codegen.js

@@ -108,10 +108,6 @@ function genData (el: ASTElement): string | void {
   const dirs = genDirectives(el)
   if (dirs) data += dirs + ','
 
-  // pre
-  if (el.pre) {
-    data += 'pre:true,'
-  }
   // key
   if (el.key) {
     data += `key:${el.key},`

+ 0 - 4
src/core/vdom/patch.js

@@ -247,10 +247,6 @@ export function createPatchFunction (backend) {
     if (isDef(i = vnode.data) && isDef(hook = i.hook) && isDef(i = hook.prepatch)) {
       i(oldVnode, vnode)
     }
-    // skip nodes with v-pre
-    if (isDef(i = vnode.data) && i.pre) {
-      return
-    }
     let elm = vnode.elm = oldVnode.elm
     const oldCh = oldVnode.children
     const ch = vnode.children

+ 0 - 8
test/unit/modules/compiler/codegen.spec.js

@@ -38,14 +38,6 @@ describe('codegen', () => {
     )
   })
 
-  it('generate v-pre', () => {
-    assertCodegen(
-      '<div v-pre><p>hello world</p></div>',
-      'with(this){return _m(0)}',
-      [`with(this){return _h(_e('div',{pre:true}),[_h(_e('p'),[_t("hello world")])])}`]
-    )
-  })
-
   it('generate v-for directive', () => {
     assertCodegen(
       '<li v-for="item in items" track-by="item.uid"></li>',