Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(v-pre): do not alter attributes (fix #10087) #10088

Merged
merged 4 commits into from Sep 21, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 1 addition & 3 deletions src/platforms/web/runtime/modules/attrs.js
Expand Up @@ -60,9 +60,7 @@ function updateAttrs (oldVnode: VNodeWithData, vnode: VNodeWithData) {
}

function setAttr (el: Element, key: string, value: any, isInPre: any) {
if (el.tagName.indexOf('-') > -1) {
baseSetAttr(el, key, value)
} else if(isInPre) {
if (el.tagName.indexOf('-') > -1 || isInPre) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wouldn't checking isInPre first be more optimal?

posva marked this conversation as resolved.
Show resolved Hide resolved
baseSetAttr(el, key, value)
} else if (isBooleanAttr(key)) {
// set attribute for blank value
Expand Down