多租户商城-商户端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

39 lines
987 B

<template>
<el-cascader style="width: 100%"
ref="cascader"
:options="categoryList"
:props="{ checkStrictly: true,label: 'categoryName',value: 'id',children: 'childs' }"
clearable></el-cascader>
</template>
<script>
import api from '@@/components/canvasShow/config/api'
import {sendReqMixin} from '@@/components/canvasShow/config/mixin'
import {checkEmptyChild} from '@@/config/common'
export default {
name: 'category-select',
mixins: [sendReqMixin],
data () {
return {
categoryList: []
}
},
mounted () {
this.getCategory()
},
methods: {
// 获取类别
getCategory () {
var _this = this
let params = {
url: api.getClassify,
method: 'GET'
}
this.sendReq(params, (res) => {
_this.categoryList = res.data
checkEmptyChild(_this.categoryList)
})
}
}
}
</script>