![](https://img-blog.csdnimg.cn/20201014180756913.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
vue
czx_2019
这个作者很懒,什么都没留下…
展开
-
vue An import path cannot end with a ‘.ts‘ extensi
引入src/store/index.ts报错import store from 'src/store/index.ts'改成import store from 'src/store'原创 2022-03-13 14:16:04 · 2660 阅读 · 0 评论 -
Error in callback for watcher “options“: “TypeError: Cannot read property ‘level‘ of null“
使用element-ui里面的级联选择器el-cascader报错Error in callback for watcher "options": "TypeError: Cannot read property 'level' of null"解决方法:1 加v-if, options是你的数据源 <el-cascader v-if="options.length" " v-model="problemIds" :options="options" :props="cascaderPros"原创 2021-06-22 10:31:51 · 3677 阅读 · 0 评论 -
v-charts的x轴名称太长显示不全
效果:实际:改变grid的right,这个值意思是容器距离右侧的距离extend1 : {grid: {show: true,left: ‘20’,right: ‘10%’,//x轴的名称太长显示不全},原创 2021-04-20 14:02:33 · 632 阅读 · 0 评论 -
element ui Error in callback for watcher “options“: “TypeError: Cannot read property ‘level‘ o
这是在使用element ui中的cascader出现的报错原因暂时不清楚,个人理解可能是因为数据源没得到及时更新,而vue是数据驱动的,所以我加了监听器,并且给cascader绑定了一个key,这样只要监听到数据源发生变化,key 就变化,就重新渲染<el-cascader :key="keyValue" //keyValue在data中定义,初始值为0 clearable :props="propsObj" v-model="value" :options=.原创 2020-09-03 22:59:21 · 12210 阅读 · 2 评论 -
重写vue的computed的get和set
比如,有一个checkList数组,在computed中重写它的get和setcomputed() { checkList: { get() { //return 一个值 } set(newVal) { } }}原创 2020-09-01 15:00:25 · 606 阅读 · 0 评论 -
elementUI中的el-checkbox报错Cannot read property ‘length‘ of undefined
在使用el-checkbox时遇上这样的错误:TypeError: Cannot read property ‘length’ of undefinedat VueComponent.isLimitDisabled (element-ui.common.js?ccbf:6452)at Watcher.get (vue.esm.js?efeb:4482)at Watcher.evaluate (vue.esm.js?efeb:4587)at VueComponent.computedGetter [原创 2020-09-01 11:03:16 · 16642 阅读 · 10 评论 -
element ui级联选择器props的配置
为什么要配置el-cascader的props?如果配置了这个选项,请求回来的数据,根本不用你去递归处理,只需要把响应的数据赋值给数据源cateList代码如下:<el-cascader v-model="cateValue" :options="cateList" :props="cateListProps" ></el-cascader>data中:cateList: [], //数据源cateListProps:原创 2020-08-28 11:19:41 · 5845 阅读 · 7 评论 -
“TypeError: this.$confirm is not a function“以及“TypeError: this.$message is not a function“
TypeError: this.$confirm is not a functionTypeError: this.$message is not a function在使用element ui时候,报错,我都是局部引入的,连个报错原因是一样的,因为没有在vue的实例上挂载$confirm和$message导致的报错解决方法:在你的入口文件main.js中:import { Message, MessageBox } from 'element-ui' //引入Message, MessageB原创 2020-08-27 19:51:49 · 5827 阅读 · 2 评论 -
vue+element 动态面包屑导航
核心代码watch: { $route() { this.getBreadcrumb() }}methods: { getBreadcrumb() { console.log(this.$route.matched) //可以获取上下文路由 也就是可以获取父亲和孩子路由组成的数组 if (Object.keys(this.$route.matched[0].meta).length > 0) { this.bread.原创 2020-08-25 21:44:46 · 1731 阅读 · 2 评论 -
vue fast-click input点击失效 点击多次才能聚焦
FastClick.prototype.focus = function(targetElement) { var length;// Issue #160: on iOS 7, some input elements (e.g. date datetime month) throw a vague TypeError on setSelectionRange. These elements don't have an integer value for the selectionStart and s转载 2020-08-02 23:30:02 · 506 阅读 · 0 评论 -
[Intervention] Ignored attempt to cancel a touchmove event with cancelable=false, for example becaus
使用vue-awesome-swiper时报的错1、[Intervention] Ignored attempt to cancel a touchmove event with cancelable=false, for example because scrolling is in progress and cannot be interrupted.解决方案:给body加上ontouchstart这个操作是进行手机端兼容处理的,防止伪类:active失效。2、Module not f原创 2020-07-25 19:30:28 · 2541 阅读 · 2 评论