if (location.host == “192.168.1.114”) {
var base_url = “http://192.168.1.114/”;
} else {
var base_url = “http://www.godo.com/”;
}
var api = {
/* 分類
列表
*/
levelGoods: base_url + “index/category/levelGoods”,
}
調用
var app = new Vue({
el: “#app”,
data: {
info: “”,/* 商品列表 /
list: “”,/ 商品分類名稱 */
},
mounted: function () {
this.view();
},
methods: {
view: function () {
var _this = this;
$.ajax({
url: api.levelGoods,
dataType: “json”,
type: “post”,
success: function (res) {
_this.info = res.data.data;
}
})
},