当前位置: 代码迷 >> 综合 >> npm Vue(4)管理后台开发4商品分类
  详细解决方案

npm Vue(4)管理后台开发4商品分类

热度:22   发布时间:2024-01-18 08:10:15.0

商品分类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>

  相关解决方案