xgqfrms™, xgqfrms® : xgqfrms's offical website of cnblogs! xgqfrms™, xgqfrms® : xgqfrms's offical website of GitHub!

vue components registration & vue error & Unknown custom element

vue components registration & vue error & Unknown custom element

vue.esm.js:629 [Vue warn]: Unknown custom element: - did you register the component correctly? For recursive components, make sure to provide the "name" option.

https://github.com/xgqfrms/angular-1.4.3/issues/4


  // 挂载 vue components
  setTimeout (() => {
    const dom = document.querySelector('zwy-spu-prodcut');
    console.log(`custom element dom`, dom);
    new Vue ({
      el: dom,
      // name: "zwy-spu",
      components: {
        // ZwySpuProduct,// Error
        "zwy-spu-prodcut": ZwySpuProduct,// OK
      },
      data () {
        return {
          id: $stateParams.activityId,
          // activityId: $stateParams.activityId,
        };
      },
    });
  }, 0);



posted @ 2020-01-14 10:23  xgqfrms  阅读(274)  评论(2编辑  收藏  举报