1.vuejs组件之间的调用components
注意:报错Do not use built-in or reserved
修改组件的名字,例如不能使用address为组件名字
组件名字不要使用内置的或保留
App.
2.vue引入外部的
./代表当前项目,../代表上一级项目
import '../static/style/reset.
如果引用的
3.关于购物车,Cannot read property ‘get’ of undefined(…)
解决办法:
在app.vue里面引入
解决方案:
1.在index里面引入axios.
axios({
method: 'get',
url: '/static/style/cart.json',
data: {
}
})
第二种:使用vue-source,引入外部的
注意引入顺序
这是cart.js里面的内容
cartView:function(){
var _this=this //记得写在get上面,不然取不到值
this.$http.get('/static/style/cart.json',{'id':123}).then(function(res){
this.pro=res.body.name;
//_this.produceList=res.body.result.list;
console.log(res.body.name)
})
}
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持前端开发者。