<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<script src="vue.js" type="text/javascript" charset="utf-8"></script>
<script src="https://cdn.bootcss.com/vue-resource/1.5.1/vue-resource.min.js"></script>
</head>
<body>
<div id="app">
<button @click="tap()">点击我</button>
</div>
</body>
</html>
<script type="text/javascript">new Vue({
el: '#app',
data:{
list:''
},
methods: {
tap() {
//说明 vue文件在上面 resource文件在下面不可以改变方向
this.$http.jsonp("https://m.cncn.com/c/index_line_ajax.php?m=get&type_en=guonei",{
jsonp:'cb'
}).then(function(data){
console.log(data)
},function(){
})
}
}
})
</script>
网友评论