feat(runtime-dom): v-model directive runtime

This commit is contained in:
Evan You
2019-10-11 17:55:20 -04:00
parent a371b2ec0e
commit a42ad6cc9d
5 changed files with 262 additions and 47 deletions

View File

@@ -13,5 +13,10 @@ export function patchDOMProp(
if ((key === 'innerHTML' || key === 'textContent') && prevChildren != null) {
unmountChildren(prevChildren, parentComponent, parentSuspense)
}
if (key === 'value' && el.tagName !== 'PROGRESS') {
// store value as _value as well since
// non-string values will be stringified.
el._value = value
}
el[key] = value == null ? '' : value
}