We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
vm
setup
1 parent ced16f0 commit d6ffe8bCopy full SHA for d6ffe8b
src/util/runtime.ts
@@ -11,6 +11,9 @@ export function getRuntimeVM(): Vue {
11
throw new ReferenceError('[vue-hooks] Not found vue instance.');
12
}
13
14
-export function setRuntimeVM(this: Vue, vm?: Vue) {
15
- runtime.vm = this || vm;
+export function setRuntimeVM(this: Vue, vue?: Vue) {
+ const vm = this || vue;
16
+ if (typeof vm.$options.setup === 'function') {
17
+ runtime.vm = vm;
18
+ }
19
0 commit comments