<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>错误的用法</title>
</head>
<body>
<div id="app">
{{sayHello()}}
</div>
<script src="../js/vue.js"></script>
<script>
let user = {
name:'liu',
city:'beijing'
};
let vm = new Vue({
el:'#app',
data:user,
methods:{
sayHello:()=> `欢迎来自${this.city}的${this.name}!`
}
});
/*
箭头函数不是绑定的自己的this指针,实际上是windows对象
*/
</script>
</body>
</html>
vue-前端第2章instance05.html
原创虾米大王 ©著作权
文章标签 vue.js javascript 前端 html ci 文章分类 JavaScript 前端开发

-
vue-前端第2章instance08.html
【代码】vue-前端第2章instance08.html。
javascript vue.js 前端 html ci -
vue-前端第2章instance03.html
【代码】vue-前端第2章instance03.html。
vue.js javascript 前端 html ci -
vue-前端第2章instance04.html
【代码】vue-前端第2章instance04.html。
javascript vue.js 前端 ci html -
vue-前端第2章instance02.html
【代码】vue-前端第2章instance02.html。
javascript vue.js 前端 Math html -
vue-前端第2章instance06.html
【代码】vue-前端第2章instance06.html。
vue.js javascript 前端 html ci -
vue-前端第2章instance07.html
【代码】vue-前端第2章instance07.html。
vue.js javascript 前端 html ci -
vue-前端第2章instance01.html
【代码】vue-前端第2章instance01.html。
vue.js javascript 前端 html ci -
vue-其他第2章instance-02.html
【代码】vue-其他第2章instance-02.html。
vue.js javascript 前端 html ci -
vue-前端第3章computed05.html
【代码】vue-前端第3章computed05.html。
vue.js javascript 前端 html Math -
vue-前端第7章v-if05.html
【代码】vue-前端第7章v-if05.html。
vue.js javascript 前端 html Vue -
vue-前端第5章event05.html
【代码】vue-前端第5章event05.html。
vue.js javascript 前端 html Vue -
vue-前端第9章component05.html
【代码】vue-前端第9章component05.html。
vue.js javascript 前端 html Vue -
vue-前端第8章demoTwo05.html
【代码】vue-前端第8章demoTwo05.html。
vue.js sed ico html -
vue-前端第3章watch05.html
【代码】vue-前端第3章watch05.html。
vue.js javascript 前端 html ci -
vue-前端第6章form05.html
【代码】vue-前端第6章form05.html。
javascript 前端 dreamweaver python php -
vue-前端第4章class05.html
【代码】vue-前端第4章class05.html。
javascript vue.js 前端 html css -
vue-前端第12章transition05.html
【代码】vue-前端第12章transition05.html。
html javascript 前端 ide 开发技术 -
vue-案例教程第2章05.html
【代码】vue-案例教程第2章05.html。
javascript 前端 html -
vue-前端第11章ajax-demo05.html
【代码】vue-前端第11章ajax-demo05.html。
javascript 前端 html ios ajax