<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>钩子函数</title>
</head>
<body>
<div id="app">
</div>
<script src="../js/vue.js"></script>
<script>
let user = {
name:'',
city:''
};
let vm = new Vue({
el:'#app',
data:user,
mounted:function () {
user = getUserFromApi();
//可以使用ajax
},
methods:{
sayHello(){
return `欢迎来自${this.city}的${this.name}!`;
}
}
});
</script>
</body>
</html>
vue-前端第2章instance08.html
原创
©著作权归作者所有:来自51CTO博客作者虾米大王的原创作品,请联系作者获取转载授权,否则将追究法律责任

提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
vue-前端第2章instance03.html
【代码】vue-前端第2章instance03.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章instance05.html
【代码】vue-前端第2章instance05.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章instance-02.html
【代码】vue-其他第2章instance-02.html。
vue.js javascript 前端 html ci -
vue-前端第4章class08.html
【代码】vue-前端第4章class08.html。
css html javascript vue.js -
vue-前端第9章component08.html
【代码】vue-前端第9章component08.html。
vue.js javascript 前端 html Vue -
vue-前端第5章event08.html
【代码】vue-前端第5章event08.html。
javascript css html 修饰符 -
vue-前端第6章form08.html
【代码】vue-前端第6章form08.html。
javascript 前端 vue.js html python -
vue-前端第7章v-if08.html
【代码】vue-前端第7章v-if08.html。
vue.js javascript 前端 html Vue -
vue-前端第3章watch08.html
【代码】vue-前端第3章watch08.html。
vue.js javascript 前端 html 数组 -
vue-前端第12章transition08.html
【代码】vue-前端第12章transition08.html。
vue.js html Math css -
vue-案例教程第2章08.html
【代码】vue-案例教程第2章08.html。
vue.js html javascript -
vue-前端第11章ajax-demo08.html
【代码】vue-前端第11章ajax-demo08.html。
vue.js javascript 前端 ios html -
vue-案例教程第3章08.html
【代码】vue-案例教程第3章08.html。
vue.js html javascript -
vue-案例教程第5章08.html
【代码】vue-案例教程第5章08.html。
vue.js bc html javascript