File tree Expand file tree Collapse file tree 3 files changed +13
-0
lines changed
Expand file tree Collapse file tree 3 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -34,6 +34,7 @@ declare interface VNodeData {
3434 key ? : string | number ;
3535 slot ? : string ;
3636 ref ? : string ;
37+ pre ? : boolean ;
3738 tag ? : string ;
3839 staticClass ? : string ;
3940 class ?: any ;
Original file line number Diff line number Diff line change @@ -164,6 +164,10 @@ function genData (el: ASTElement): string {
164164 if ( el . refInFor ) {
165165 data += `refInFor:true,`
166166 }
167+ // pre
168+ if ( el . pre ) {
169+ data += `pre:true,`
170+ }
167171 // record original tag name for components using "is" attribute
168172 if ( el . component ) {
169173 data += `tag:"${ el . tag } ",`
Original file line number Diff line number Diff line change @@ -84,6 +84,7 @@ export function createPatchFunction (backend) {
8484 }
8585 }
8686
87+ let inPre = 0
8788 function createElm ( vnode , insertedVnodeQueue , nested ) {
8889 let i
8990 const data = vnode . data
@@ -103,7 +104,11 @@ export function createPatchFunction (backend) {
103104 const tag = vnode . tag
104105 if ( isDef ( tag ) ) {
105106 if ( process . env . NODE_ENV !== 'production' ) {
107+ if ( data && data . pre ) {
108+ inPre ++
109+ }
106110 if (
111+ ! inPre &&
107112 ! vnode . ns &&
108113 ! ( config . ignoredElements && config . ignoredElements . indexOf ( tag ) > - 1 ) &&
109114 config . isUnknownElement ( tag )
@@ -124,6 +129,9 @@ export function createPatchFunction (backend) {
124129 if ( isDef ( data ) ) {
125130 invokeCreateHooks ( vnode , insertedVnodeQueue )
126131 }
132+ if ( process . env . NODE_ENV !== 'production' && data && data . pre ) {
133+ inPre --
134+ }
127135 } else if ( vnode . isComment ) {
128136 vnode . elm = nodeOps . createComment ( vnode . text )
129137 } else {
You can’t perform that action at this time.
0 commit comments