修改站点组件接收参数并修改使用时的传参
This commit is contained in:
@ -2,7 +2,7 @@
|
||||
<el-cascader
|
||||
:size="size"
|
||||
:style="{ width: limitWidth ? '240px' : '100%' }"
|
||||
v-model="tenant_id"
|
||||
v-model="value.tenant_id"
|
||||
clearable
|
||||
separator="-"
|
||||
placeholder="请选择,支持搜索"
|
||||
@ -15,7 +15,7 @@
|
||||
import { tenantSelect } from "@/api/subPlatform/tenant";
|
||||
export default {
|
||||
props: {
|
||||
value: String,
|
||||
value: Object,
|
||||
size: {
|
||||
type: String,
|
||||
default: "small",
|
||||
@ -28,24 +28,23 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
tenantOptions: [],
|
||||
tenant_id: undefined,
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
value: {
|
||||
handler(newVal, oldVal) {
|
||||
if (newVal == "") {
|
||||
this.tenant_id = undefined;
|
||||
} else {
|
||||
this.tenant_id = newVal;
|
||||
}
|
||||
},
|
||||
immediate: true,
|
||||
},
|
||||
tenant_id(newVal, oldVal) {
|
||||
this.$emit("handleChange", newVal);
|
||||
},
|
||||
},
|
||||
// watch: {
|
||||
// value: {
|
||||
// handler(newVal, oldVal) {
|
||||
// if (newVal == "" || newVal == null) {
|
||||
// this.tenant_id = undefined;
|
||||
// } else {
|
||||
// this.tenant_id = newVal;
|
||||
// }
|
||||
// },
|
||||
// immediate: true,
|
||||
// },
|
||||
// tenant_id(newVal, oldVal) {
|
||||
// this.$emit("handleChange", newVal);
|
||||
// },
|
||||
// },
|
||||
created() {
|
||||
tenantSelect().then((res) => {
|
||||
for (const key in res.data) {
|
||||
|
||||
Reference in New Issue
Block a user