
VUE常见错误
yaoxinsong
我正在运用自己的思维,以最简单的代码组装强大的功能。之所以做笔记是因为学的东西太多,不怎么用的东西太长时间不用就忘了。
展开
-
CarouselMap.vue?d88f:80 Uncaught TypeError: Cannot read property ‘style‘ of undefined
<div class="rectangle-box"> <div class="item" ref="imgItem" :style="{'top': imgItemLeft}" ></div> </div> // 正确写法 this.imgItemLeft = id * 80; // 错误写法 this.$refs.imgItem.style.left = (id * 80) + 'px';原创 2021-02-10 21:48:37 · 269 阅读 · 0 评论 -
关于VueRouter的低级错误
component被写成了components所以跳转路由的时候没反应(注释的代码为错误代码),看了VueRouter的官方文档,再次证明基础很重要。 // import Vue from 'vue'; // import Router from 'vue-router'; // Vue.use(Router); // export default new Router({ // mode: 'history', // router: [ // { // path: '/testRoute原创 2020-11-20 22:36:58 · 419 阅读 · 0 评论 -
error Mixed spaces and tabs no-mixed-spaces-and-tabs
打开package.json文件 搜索rules然后改成 "rules": {"no-tabs":"off"} 重启服务原创 2020-10-25 22:57:24 · 952 阅读 · 1 评论