]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
feat: process certain attrs as properties
authorEvan You <yyx990803@gmail.com>
Fri, 12 Oct 2018 21:42:08 +0000 (17:42 -0400)
committerEvan You <yyx990803@gmail.com>
Fri, 12 Oct 2018 21:42:08 +0000 (17:42 -0400)
packages/renderer-dom/src/modules/attrs.ts
packages/renderer-dom/src/patchData.ts

index d32f6608e0177da967076b0f8ffcdfd5346f1241..3254f0fcbaa4b4175b81f5d9b0c8e2c991c75685 100644 (file)
@@ -1,3 +1,13 @@
+const xlinkNS = 'http://www.w3.org/1999/xlink'
+
+function isXlink(name: string): boolean {
+  return name.charAt(5) === ':' && name.slice(0, 5) === 'xlink'
+}
+
+function getXlinkProp(name: string): string {
+  return isXlink(name) ? name.slice(6, name.length) : ''
+}
+
 export function patchAttr(
   el: Element,
   key: string,
@@ -19,13 +29,3 @@ export function patchAttr(
     }
   }
 }
-
-const xlinkNS = 'http://www.w3.org/1999/xlink'
-
-function isXlink(name: string): boolean {
-  return name.charAt(5) === ':' && name.slice(0, 5) === 'xlink'
-}
-
-function getXlinkProp(name: string): string {
-  return isXlink(name) ? name.slice(6, name.length) : ''
-}
index be805a54bb2556d5d7626022ca84398a2c53c090..d13e8057884f70eb763758bc6ae5643bc72504e2 100644 (file)
@@ -6,7 +6,9 @@ import { patchDOMProp } from './modules/props'
 import { patchEvent } from './modules/events'
 
 export const onRE = /^on/
-const domPropsRE = /^domProps/
+
+// value, checked, selected & muted are always patched as properties
+const domPropsRE = /^domProps|^(?:value|checked|selected|muted)$/
 
 export function patchData(
   el: Element,