Vue Error in render function: "TypeError: _self.$scopedSlots.default is not a function

Vue+el标签使用v-if ,v-else 进行切换的时候报错

Error in render function: "TypeError: _self.$scopedSlots.default is not a function


TypeError: _self.$scopedSlots.default is not a function

    at renderCell (element-ui.common.js:10738)

    at Proxy.column.renderCell (element-ui.common.js:10753)

    at element-ui.common.js:8846

    at Proxy.renderList (vue.esm.js:3910)

    at element-ui.common.js:8834

    at Proxy.renderList (vue.esm.js:3910)

    at Proxy.render (element-ui.common.js:8809)

    at VueComponent.Vue._render (vue.esm.js:4195)

    at VueComponent.updateComponent (vue.esm.js:2574)

    at Watcher.get (vue.esm.js:2917)

解决办法:

在使用v-if和v-else的标签上加上一个唯一标识key

例如:

<section  v-if="visible"  key="key1">  

</section>

<section  v-else  key="key2">

</section>

其中key1和key2都是唯一标识。

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容