8000 fix(setup): make all none-binding property to bindings · Kingwl/vue-function-api@750f309 · GitHub
[go: up one dir, main page]

Skip to content

Commit 750f309

Browse files
committed
fix(setup): make all none-binding property to bindings
1 parent 6a9698f commit 750f309

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

src/setup.ts

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { VueConstructor } from 'vue';
22
import { SetupContext } from './types/vue';
33
import { isWrapper } from './wrappers';
44
import { setCurrentVM } from './runtimeContext';
5-
import { isPlainObject, assert, proxy, isFunction } from './utils';
5+
import { isPlainObject, assert, proxy } from './utils';
66
import { value } from './functions/state';
77

88
export function mixin(Vue: VueConstructor) {
@@ -58,17 +58,12 @@ export function mixin(Vue: VueConstructor) {
5858

5959
Object.keys(binding).forEach(name => {
6060
let bindingValue = binding[name];
61-
if (bindingValue === undefined) return;
6261
// make plain value reactive
63-
if (!isWrapper(bindingValue) && !isFunction(bindingValue) && !Object.isFrozen(bindingValue)) {
62+
if (!isWrapper(bindingValue)) {
6463
bindingValue = value(bindingValue);
6564
}
6665
// bind to vm
67-
if (isWrapper(bindingValue)) {
68-
bindingValue.setVmProperty(vm, name);
69-
} else {
70-
vm[name] = bindingValue;
71-
}
66+
bindingValue.setVmProperty(vm, name);
7267
});
7368
}
7469

0 commit comments

Comments
 (0)
0