diff --git a/runtime/vue-runtime-help/package.json b/runtime/vue-runtime-help/package.json index f2f81f0c..1d65c2ed 100644 --- a/runtime/vue-runtime-help/package.json +++ b/runtime/vue-runtime-help/package.json @@ -1,5 +1,5 @@ { - "version": "1.1.1", + "version": "1.1.2", "name": "@tmagic/vue-runtime-help", "type": "module", "sideEffects": false, diff --git a/runtime/vue-runtime-help/src/hooks/use-app.ts b/runtime/vue-runtime-help/src/hooks/use-app.ts index 071a87d5..a69942c4 100644 --- a/runtime/vue-runtime-help/src/hooks/use-app.ts +++ b/runtime/vue-runtime-help/src/hooks/use-app.ts @@ -65,13 +65,17 @@ export const registerNodeHooks = (node?: TMagicNode, methods: Methods = {}) => { }; export const useApp = ({ - methods = {}, + methods, config, iteratorContainerId, iteratorIndex, }: UseAppOptions) => { const app = inject('app'); + if (!app) { + throw new Error(`component ${config.type}: app is not injected`); + } + const node = useNode( { config, @@ -81,7 +85,7 @@ export const useApp = ({ app, ); - if (node) { + if (node && methods) { registerNodeHooks(node, methods); }