- 博客(5)
- 收藏
- 关注
原创 报错问题 TypeError: _this2.$message.erro is not a function
经过:进行axios通信的时候,出现了报错的情况,代码如下 async updateUserInfo () { try { // 后台接口接收 三个数据 不能是 user 包含更多数据 const { name, intro, email } = this.user await this.http.patch(′user/profile′,name,intro,email)this.http.patch('user/profile', { name, intro, email }) .
2020-06-14 11:02:26
3435
1
原创 To install it, you can run: npm install --save @/views/setting
经过:在vue的router里面配置路径后,就报错了 ,当时认为是自己缺少某个模块,然后npm i之后发现还是报错 原因:是因为自己的组件地址错误,我把setting组件写到src文件的外面,而导入组件地址则是用的‘@/settiing’,当然找不到组件setting了,也就会报错了 解决:将setting组件剪切到src目录下,完美解决 ...
2020-06-13 16:52:45
13252
原创 关于vue-router使用步骤
1. 首先通过npm i vue-router 2. 引入到路由配置js文件,同时这个js文件也要引入vue,然后vuerouter挂载到全局使用 import VueRouter from 'vue-router' import Vue from 'vue' // 挂载到全局使用 Vue.use(VueRouter) 3. new一个vuerouter,然后配置路由文件,其中要注意,配置文件是routes:[ ] , 千万别写错,不然不会显示 const router = new VueRo
2020-05-24 14:31:50
479
原创 Cannot set property 'className' of undefined
var spans = document.querySelectorAll('.buttons span'); spans[2].className='red' 在给spans里面的span添加属性的时候一直报错,无法设置未定义的属性className 是因为span标签是动态创建(通过createElement),并且动态添加到页面上的(通过appendChild) 而我一开始我把获取span标签的方法放到了全局作用域,这时候页面还没有渲染span标签,所以获取到的span为undifin...
2020-05-11 18:45:30
777
原创 dataset使用方法
dataset使用方法 Uncaught TypeError: Cannot read property ‘style’ of null at HTMLLIElement.lis..onclick (3.切换的导航栏.html:116) // An highlighted block <!DOCTYPE html> <html lang="en"> <head>...
2019-11-09 22:40:20
644
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人