add code
This commit is contained in:
@@ -0,0 +1,54 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title></title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="app">
|
||||
{{ message }}
|
||||
|
||||
<ul id="example-1">
|
||||
<li v-for="item in nearDists">
|
||||
{{ item.name }}
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<button onclick="clicked('error.html')">click</button>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript" src="js/common.js"></script>
|
||||
<script src="js/vue.js"></script>
|
||||
<script src="js/mui.min.js"></script>
|
||||
<script>
|
||||
mui.init();
|
||||
var app = new Vue({
|
||||
el: '#app',
|
||||
data: {
|
||||
message: 'Hello Vue!',
|
||||
nearDists:[]
|
||||
},mounted:function() {
|
||||
var that = this;
|
||||
mui.ajax('http://192.168.10.170:8084/house/loadNearDistricts',{
|
||||
data:{
|
||||
lng:121.497039,lat:31.282122
|
||||
},
|
||||
dataType:'json',
|
||||
type:'get',
|
||||
success:function(data){
|
||||
//获得服务器响应
|
||||
that.nearDists = data.nearDists;
|
||||
console.log(data)
|
||||
}
|
||||
});
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
Reference in New Issue
Block a user