Просмотр исходного кода

guard input value as string for v-model

Evan You 10 лет назад
Родитель
Сommit
0c9c6ed08d
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      src/platforms/web/compiler/directives/model.js

+ 1 - 1
src/platforms/web/compiler/directives/model.js

@@ -106,7 +106,7 @@ function genDefaultModel (
   if (needCompositionGuard) {
     code = `if($event.target.composing)return;${code}`
   }
-  addProp(el, 'value', `(${value})`)
+  addProp(el, 'value', `_s(${value})`)
   addHandler(el, event, code)
   if (needCompositionGuard) {
     // need runtime directive code to help with composition events