|
@@ -4,7 +4,7 @@ const ProductType = {
|
|
|
<a-cascader
|
|
|
@change="handleChange"
|
|
|
change-on-select
|
|
|
- :value="value"
|
|
|
+ :value="defaultVal"
|
|
|
expand-trigger="hover"
|
|
|
:options="productTypeList"
|
|
|
:fieldNames="{ label: 'productTypeName', value: 'productTypeSn', children: 'children' }"
|
|
@@ -13,7 +13,7 @@ const ProductType = {
|
|
|
allowClear />
|
|
|
`,
|
|
|
props: {
|
|
|
- defaultVal: {
|
|
|
+ value: {
|
|
|
type: Array,
|
|
|
defatut: function(){
|
|
|
return []
|
|
@@ -26,16 +26,21 @@ const ProductType = {
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
- value: this.defaultVal,
|
|
|
+ defaultVal: this.value,
|
|
|
productTypeList: []
|
|
|
};
|
|
|
},
|
|
|
+ watch: {
|
|
|
+ value(newValue, oldValue) {
|
|
|
+ this.defaultVal = newValue
|
|
|
+ }
|
|
|
+ },
|
|
|
mounted() {
|
|
|
this.getProductType()
|
|
|
},
|
|
|
methods: {
|
|
|
handleChange(value) {
|
|
|
- this.value = value;
|
|
|
+ this.defaultVal = value;
|
|
|
this.$emit('change', this.value);
|
|
|
},
|
|
|
// 产品分类列表
|