File tree 3 files changed +13
-0
lines changed
3 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -34,6 +34,7 @@ declare interface VNodeData {
34
34
key ? : string | number ;
35
35
slot ? : string ;
36
36
ref ? : string ;
37
+ pre ? : boolean ;
37
38
tag ? : string ;
38
39
staticClass ? : string ;
39
40
class ?: any ;
Original file line number Diff line number Diff line change @@ -164,6 +164,10 @@ function genData (el: ASTElement): string {
164
164
if ( el . refInFor ) {
165
165
data += `refInFor:true,`
166
166
}
167
+ // pre
168
+ if ( el . pre ) {
169
+ data += `pre:true,`
170
+ }
167
171
// record original tag name for components using "is" attribute
168
172
if ( el . component ) {
169
173
data += `tag:"${ el . tag } ",`
Original file line number Diff line number Diff line change @@ -84,6 +84,7 @@ export function createPatchFunction (backend) {
84
84
}
85
85
}
86
86
87
+ let inPre = 0
87
88
function createElm ( vnode , insertedVnodeQueue , nested ) {
88
89
let i
89
90
const data = vnode . data
@@ -103,7 +104,11 @@ export function createPatchFunction (backend) {
103
104
const tag = vnode . tag
104
105
if ( isDef ( tag ) ) {
105
106
if ( process . env . NODE_ENV !== 'production' ) {
107
+ if ( data && data . pre ) {
108
+ inPre ++
109
+ }
106
110
if (
111
+ ! inPre &&
107
112
! vnode . ns &&
108
113
! ( config . ignoredElements && config . ignoredElements . indexOf ( tag ) > - 1 ) &&
109
114
config . isUnknownElement ( tag )
@@ -124,6 +129,9 @@ export function createPatchFunction (backend) {
124
129
if ( isDef ( data ) ) {
125
130
invokeCreateHooks ( vnode , insertedVnodeQueue )
126
131
}
132
+ if ( process . env . NODE_ENV !== 'production' && data && data . pre ) {
133
+ inPre --
134
+ }
127
135
} else if ( vnode . isComment ) {
128
136
vnode . elm = nodeOps . createComment ( vnode . text )
129
137
} else {
You can’t perform that action at this time.
0 commit comments