我们在实际项目中经常会遇到el-table-column条件渲染出现报错的情况 报错内容: h.$scopedSlots.default is not a function 究其原因,是因为表格是element-ui通过循环产生的,而vue在dom重新渲染时有一个性能优化机制,就是相同dom会被复用,这就是问题所在,所以,通过key去标识一下当前行是唯一的,不许复用,就行了. 代码示例如下: 添加 :key="Math.random()" <el-table :data=&quo…
VueJs + Element 话不多说,直接贴错: _self.$scopedSlots.default is not a function <el-table stripe border ref="tableData" max-height="500" v-loading="loading" v-bind:data="tableData" @row-dblclick="doubbleClick"…
如果直接使用Element做时间选择器,其规则(rules)不添加type:'date',会提示类型错误,处理这个需要规范值的类型为date. 时间格式化过滤器 import Vue from 'vue' import service from './service.js' import onlineIcon from '@/assets/img/map/tsp_green.png' import unlineIcon from '@/assets/img/map/tsp_gray.png' i…
vue使用v-for时vscode报错 Elements in iteration expect to have 'v-bind:key' directives Vue 2.2.0+的版本里,当在组件中使用v-for时,key是必须的错误提示:[vue-language-server] Elements in iteration expect to have 'v-bind:key' directives.Renders the element or template block multipl…