项目中遇到问题
rsancy
所有痛苦都源于对自己无能的愤怒!
展开
-
正则零宽断言在IOS兼容性问题
letregx=/(?<=\$).*?(?=\$)/g;原创 2021-06-17 17:31:41 · 4867 阅读 · 0 评论 -
vue项目报错[Vue warn]: Property “visible“ must be accessed with “$data.visible“ because properties start
vue项目中报错:[Vue warn]: Property "visible" must be accessed with "$data.visible" because properties starting with "$" or "_" are not proxied in the Vue instance to prevent conflicts with Vue internalsSee: https://vuejs.org/v2/api/#data如下:报错原因:项目中是El转载 2020-07-03 17:08:59 · 35495 阅读 · 19 评论 -
vue报错 Error in callback for immediate watcher "height": "TypeError: Cannot read property 'style' of
vue报错vue.esm.js?eaf6:628 [Vue warn]: Error in callback for immediate watcher "height": "TypeError: Cannot read property 'style' of undefined"TypeError: Cannot read property 'style' of undefined如下:...原创 2019-11-27 11:30:04 · 33854 阅读 · 1 评论 -
vue项目报错vue-router.esm.js?8b48:2007 Uncaught (in promise)
今天做vue项目时控制台报错:vue-router.esm.js?8b48:2007 Uncaught (in promise) NavigationDuplicated {_name: "NavigationDuplicated", name: "NavigationDuplicated"}两种解决方案:方法一:原因可能是在重新下载依赖包时,安装的vue-router还是之前...原创 2019-09-09 13:32:56 · 10457 阅读 · 3 评论 -
运行node时报错:events.js:167 throw er; // Unhandled 'error' event
今天npm run dev 启动项目时报错:报这个错通常是因为ip地址不正确,或者端口被占用。到webpack.config.js文件中发现是因为ip地址不对:解决办法:改成 host: '127.0.0.1',如果是端口被占用换个试试。再运行npm run dev,成功了!...原创 2019-07-03 15:26:07 · 6236 阅读 · 2 评论 -
npm报错:module.js:549 throw err;
解决办法:先删除node_modules整个文件夹,然后cnpm cache clean,然后cnpm install.cnpm cache clean时可能会提示这时执行cnpm cache clean --force即可,再cnpm install.。转载 2019-01-02 10:24:04 · 3081 阅读 · 0 评论 -
vue报错:"TypeError: Cannot read property 'forEach' of undefined"
在vue项目中有一个表格操作需要“获取收藏状态”的方法,其中用到了forEach,本来还好好的,结果当收藏列表为空时forEach报错了:"TypeError: Cannot read property 'forEach' of undefined" 具体代码如下://获取收藏状态getSc(items){ // console.log('对比列', this.scExi...原创 2018-09-28 16:44:03 · 45730 阅读 · 3 评论 -
5、vue报错Error in render: “TypeError: Cannot read property ‘length‘ of undefined“
vue 报错:Error in render: "TypeError: Cannot read property 'length' of undefined"通常有两种情况:1、在模板的html标签上使用length报错vue 中使用 length判断的时候,有时会报错,如下:<div class="item_list" v-if="form.checkVal.length...原创 2018-09-20 19:31:57 · 45392 阅读 · 7 评论 -
Vue中的父子组件通讯以及使用sync同步父子组件数据
目录子组件向父组件中传递数据 一. 通过props从父向子组件传递函数,调用函数改变父组件数据 二. 通过自定义事件从子组件向父组件中传递数据 三. 通过ref属性在父组件中直接取得子组件的数据(data) 通过sync实现数据双向绑定, 从而同步父子组件数据 数据双向绑定是把双刃剑 当sync修饰的prop是个对象 不要通过在子组件中修改引用类型props达到“父...转载 2018-09-17 21:03:41 · 2275 阅读 · 0 评论 -
4、vue 中报错 Error in mounted hook: "TypeError: handlers[i].call is not a function"
Vue中提示警告: 1 2 3 4 5 6 7 [Vue warn]: Error in mounted hook: "TypeError: handlers[i].call is not a function" found in ---> <Detail> a...转载 2018-09-17 20:51:01 · 21060 阅读 · 0 评论 -
3、vue报错use a data or computed property based on the prop's value.
1.原本用父组件传值给子组值,再通过更改发现报以上问题的错误 原因:prop是单向绑定,不能更改数据,只能由父组件传输过来 解决方法:可以在子组件中data中定义数据,使用$emit 和 $on 传给父组件,父组件接收后在赋值给当前要修改的数据。...原创 2018-09-17 20:42:38 · 37847 阅读 · 1 评论 -
2、使用局部覆盖element-ui的默认样式
最近在vue的项目中使用了element-ui,但是需要修改样式覆盖element -ui本身的样式,而且不能影响全局样式。 解决方法:在需要更改的组件里新增一个style标签【重点:不要加scoped】,然后直接获取class设置样式就可以咯,class在浏览器里右键审查元素可得到。建议:在获取到的样式里加上能限制范围的父层选择器,不然就变成全局样式。...转载 2018-09-17 20:28:14 · 1832 阅读 · 0 评论 -
1、VSCode使用vue的v-for方法提示错误的解决办法
使用vue做项目的过程中发现使用v-for的方法时,莫名提示错误错误示例:解决方法一:在v-for后面绑定key,示例如下→ 解决方法二:点击左下角“设置”>“用户设置”内添加一下代码片段: { "vetur.validation.template": false } ...转载 2018-09-17 20:18:37 · 1058 阅读 · 0 评论