Skip to content

Commit

Permalink
fix(src/core/vdom/patch.js): fix the bug 'root level <script> tags wi…
Browse files Browse the repository at this point in the history
…ll be executed' in issue#11483

Root level <script> tags should not be executed, for consistent behavior. So I remove the code in
<script> tag when the <script> tag is the root element of the template.

fix vuejs#11483
  • Loading branch information
shadowings-zy committed Jul 3, 2020
1 parent 8ead9d2 commit 0288b5b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/core/vdom/patch.js
Expand Up @@ -188,7 +188,10 @@ export function createPatchFunction (backend) {
insert(parentElm, vnode.elm, refElm)
}
} else {
createChildren(vnode, children, insertedVnodeQueue)
// fix:11483, remove the code in <script> tag when the <script> tag is the root element of the template.
if (vnode.tag !== 'script') {
createChildren(vnode, children, insertedVnodeQueue)
}
if (isDef(data)) {
invokeCreateHooks(vnode, insertedVnodeQueue)
}
Expand Down

0 comments on commit 0288b5b

Please sign in to comment.