商品分类classification of goods
<template>
<div>
<div>classification of goods</div>
<div>product list</div>
<div style="display:flex">
<div style="flex:1">id</div>
<div style="flex:1">img</div>
<div style="flex:1">name</div>
<div style="flex:1">operation</div>
</div>
<div style="display:flex" v-for="(a,index) in categoryList" :key="'ab-' +index">
<div style="flex:1">{{a.id}}</div>
<div style="flex:1">{{a.name}}</div>
<div style="flex:1">
<button>删除</button>
<button>修改</button>
</div>
</div>
</div>
</template>
<script>
export default {
data() {
return {
categoryList: []
};
},
created() {
this.loadCategoryList();
},
methods: {
loadCategoryList() {
var that = this;
this.axios.get(`/category/list`).then(function(response) {
console.log(response);
that.categoryList = response.data.data;
});
}
},
components: {}
};
</script>
<style>
</style>