繁体   English   中英

vuejs:我的 vue 组件没有渲染

[英]vuejs : My vue component is not rendering

我有一个 vue 组件,但是当我尝试渲染它时,它不能正确渲染,而是显示为 html 标记这里是组件代码

视图.vue

  <template>
    <div>
      <h1>This is  view component</h1>
   </div>
 </template>

<script>
 import Vue from "vue";

    export default {
        name: 'view',
        props: ["store"],
        data:function(){
              return {}
            }
         };
</script>

现在当我尝试像下面这样渲染它时

  <div>
      <b-modal ref="my-modal2" hide-footer title="Store Details" class="mt-5">
          <view :store='curStore'/>
      </b-modal>
  </div>

它给了我这个结果关于出了什么问题的任何建议? 提前致谢

我的应用程序使用以下代码安装

new Vue({
 el: '#app',
 router,
 template: '<App/>',
 components: { App }
});

您必须导入组件并将其添加到components中。

查看 Vue 文档:
https://v2.vuejs.org/v2/guide/components-registration.html#Local-Registration

import ComponentA from './ComponentA.vue'

export default {
  // ...
  components: {
    ComponentA
  },
  // ...
}

较旧的 JavaScript 版本存在细微差别。 检查上述链接以获取详细信息。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM