Vue.js: check if a component exists

前端 未结 6 1254
天命终不由人
天命终不由人 2021-02-12 13:26

I need to do some stuff in the ready: of the root instance only when some components don\'t exist (they weren\'t declared in the HTML).

How can I check if a

6条回答
  •  滥情空心
    2021-02-12 13:51

    I'm not sure if you need a dynamic method, but this may help to determine if a component exists:

    Vue.options.components['CompOne']
    

    found:

    https://github.com/vuejs/Discussion/issues/140

提交回复
热议问题