import { productTypeQuery } from '@/api/productType' const ProductType = { template: ` `, props: { value: { type: Array, defatut: function () { return [] } }, id: { type: String, default: '' } }, data () { return { defaultVal: this.value, productTypeList: [] } }, watch: { value (newValue, oldValue) { this.defaultVal = newValue } }, mounted () { this.getProductType() }, methods: { handleChange (value) { this.defaultVal = value this.$emit('change', this.defaultVal) }, // 产品分类列表 getProductType () { productTypeQuery({}).then(res => { if (res.status == 200) { this.productTypeList = res.data } else { this.productTypeList = [] } }) } } } export default ProductType