refactor: immutable -> readonly

This commit is contained in:
Evan You
2019-08-23 09:38:32 -04:00
parent e1bbfbba94
commit 589d3c2feb
8 changed files with 137 additions and 137 deletions

View File

@@ -1,4 +1,4 @@
import { immutable, toRaw, lock, unlock } from '@vue/reactivity'
import { readonly, toRaw, lock, unlock } from '@vue/reactivity'
import {
EMPTY_OBJ,
camelize,
@@ -114,7 +114,7 @@ export function resolveProps(
props[key] = val
}
// allow mutation of propsProxy (which is immutable by default)
// allow mutation of propsProxy (which is readonly by default)
unlock()
if (rawProps != null) {
@@ -179,13 +179,13 @@ export function resolveProps(
}
}
// lock immutable
// lock readonly
lock()
instance.props = __DEV__ ? immutable(props) : props
instance.props = __DEV__ ? readonly(props) : props
instance.attrs = options
? __DEV__
? immutable(attrs)
? readonly(attrs)
: attrs
: instance.props
}