Uncaught SyntaxError: Unexpected token '<'
报这个问题,简单一点:<script type="text/javascript" src="../js/vue.js"></script>导入js文件路径错了,才会报,改正确的就行
2.Uncaught SyntaxError: Unexpected token ':'
像这种错误,我常常犯,这个不是字符报错,而是代码数据等,没有放在new 的Vue({.....})对象里面,
错误代码和正常代码
new Vue();
el: '.hh',
data: {
h1: 'classll'
},
methods: {
upal() {
this.h1 = 'classll'
}
}
new Vue({
el: '.hh',
data: {
h1: 'classll'
},
methods: {
upal() {
this.h1 = 'classll'
}
}
});