1.后台数据我获取到了,并且在控制台中能打印出来,问题是我怎么把这打印的数据 ,显示在html 里面,利用起来, 而不是单纯只会在控制台打印?
<!doctype html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no">
<meta charset="UTF-8"/>
<title>Document</title>
<script src="js/vue.min.js"></script>
<script src="js/vue-resource.min.js"></script>
</head>
<body>
<div id="box">
<button @click="gets1(1)">get1</button>
{{rel}}
</div>
<script>
new Vue({
el:'#box',
data:{},
methods:{
gets1:function(num){
console.log(num);
this.$http.get('php/get.php').then(function(rel){
console.log(rel);
},function(err){
})
},
}
})
</script>
</body>
</html>
回首忆惘然
相关分类