فهرست منبع

bind value as property for <select> (fix #4369)

Evan You 9 سال پیش
والد
کامیت
1cf377f190
1فایلهای تغییر یافته به همراه2 افزوده شده و 1 حذف شده
  1. 2 1
      src/platforms/web/util/attrs.js

+ 2 - 1
src/platforms/web/util/attrs.js

@@ -3,9 +3,10 @@
 import { makeMap } from 'shared/util'
 
 // attributes that should be using props for binding
+const acceptValue = makeMap('input,textarea,option,select')
 export const mustUseProp = (tag: string, attr: string): boolean => {
   return (
-    (attr === 'value' && (tag === 'input' || tag === 'textarea' || tag === 'option')) ||
+    (attr === 'value' && acceptValue(tag)) ||
     (attr === 'selected' && tag === 'option') ||
     (attr === 'checked' && tag === 'input') ||
     (attr === 'muted' && tag === 'video')