使用Vue自定义组件时,报did you register the component correctly? For recursive components, make sure to provide the "name" option.(未注册组件)的原因

错误信息:

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

(found in <Root>)

在浏览器点击开错误的详细信息:

总结:

原文地址:https://www.cnblogs.com/oukele/p/9987287.html

时间: 2024-08-29 10:34:01

使用Vue自定义组件时,报did you register the component correctly? For recursive components, make sure to provide the "name" option.(未注册组件)的原因的相关文章

Vue入门之旅:一报错 Unknown ... make sure to provide the &quot;name&quot; option及error compiling template

报错一: Unknown custom element: <custom-select> - did you register the component correctly? For recursive components, make sure to provide the "name" option 代码: html <custom-select v-bind:list="list2"></custom-select> js

二、注册组件

2.1.注册 你通过创建ContainerBuilder对象来注册组件并且将组件暴露的服务告知builder. 组件可以通过反射来进行创建(通过注册一个特定的.NET类型或者开放的泛型(by registering a specific .NET type or open generic)):通过提供现成的实例(你创建的对象的一个实例):或者通过lambda表达式(通过一个匿名方法来执行对象的创建).你可以通过ContainerBuilder中一系列重载的Register()方法来设置创建组件的

[转] vue自定义组件中的v-model简单解释

在使用iview框架的时候,经常会看到组件用v-model双向绑定数据,与传统步骤父组件通过props传值子组件,子组件发送$emit来修改值相比,这种方式避免操作子组件的同时再操作父组件,显得子组件的封装效果更好.所以,个人认为,我们自己封装组件也应该有这样的思维,父组件通过slot或者props传值,由子组件完成一些效果,再抛出必要的事件让父组件接受,这样组件的可复用性就很强,有利于多次使用. v-model指令是什么? 刚刚提到,iview通过v-model双向绑定数据,所以首先我们要明白

vue 自定义组件 v-model双向绑定、 父子组件同步通信

父子组件通信,都是单项的,很多时候需要双向通信.方法如下: 1.父组件使用:msg.sync="aa"  子组件使用$emit('update:msg', 'msg改变后的值xxx') 2.父组件传值直接传对象,子组件收到对象后可随意改变对象的属性,但不能改变对象本身. 3.父组件使用: v-model 第一种曾经被废除过,由于维护成本的原因被删掉,但经过证实,确实有存在的意义,又被加上. 第一种: 父组件: <template> <div> <aa cl

vue自定义事件将组件内的数据传输到实例中去使用

vue自定义事件将组件内的数据传输到实例中去使用 <body> <div id="app"> <h1 style="color:deeppink">{{ outer_title }}</h1> //③给实例绑定一个方法 <hello :reader="new_msg"  v-on:chang_event="chang_tit"></hello> </

VUE.JS 使用axios数据请求时数据绑定时 报错 TypeError: Cannot set property &#39;xxxx&#39; of undefined 的解决办法

正常情况下在data里面都有做了定义 在函数里面进行赋值 这时候你运行时会发现,数据可以请求到,但是会报错 TypeError: Cannot set property 'listgroup' of undefined 主要原因是: 在 then的内部不能使用Vue的实例化的this, 因为在内部 this 没有被绑定.可以看下 Stackoverflow 的解释: 解决办法: 1.用ES6箭头函数,箭头方法可以和父方法共享变量 2.在请求axios外面定义一下 var that=this 问题

VUE - 使用axios数据请求时数据绑定时 报错 TypeError: Cannot set property &#39;xxxx&#39; of undefined 的解决办法

created() { var that=this axios.get('http://jsonplaceholder.typicode.com/todos') .then(function (res) { // handle success // console.log(res); that.todos = res.data }) .catch(function (error) { // handle error console.log(error); }) .finally(function

教你撸一个简单的Vue自定义动态组件

components下创建 toast 文件夹, 文件夹里面创建 toast.vue 和 index.js toast.vue: <template> <div id="toastWrap" :class="[className,showAnimation ?'fadein':'fadeout',appointId==''?'fixed':'absolute']" v-if="show"> <span :class=

vue自定义组件v-model

  一个组件上的`v-model`默认会利用名为`value`的prop(属性)和名为input的事件,但是像单选框.复选框等类型的输入控件可能会将`value`特性用于不同的目的.这时候我们可以在定义组件的时候,通过设置`model`选项可以用来实现不同的处理方式. 在创建组件的时候,添加`model`属性,其中要包含两个属性配置,分别是: event:什么时候触发v-model行为 prop:定义传递给v-model的那个变量,绑定到哪个属性值上 下面是实现计数器作用的代码: <!DOCTY