修改自定义显示逻辑

master
于肖磊 2024-10-09 17:48:55 +08:00
parent 308dcd0b88
commit fe4706710b
5 changed files with 52 additions and 4 deletions

View File

@ -3,16 +3,16 @@
<view class="wh-auto ht-auto pr">
<view v-for="item in form.custom_list" :key="item.id" class="main-content" :style="{ left: get_percentage_count(item.location.x, div_width), top: get_percentage_count(item.location.y, div_height), width: get_percentage_count(item.com_data.com_width, div_width), height: get_percentage_count(item.com_data.com_height, div_height) }">
<template v-if="item.key == 'text'">
<model-text :propValue="item.com_data" :propSourceList="form.data_source_content" @url_event="url_event"></model-text>
<model-text :propkey="propkey" :propValue="item.com_data" :propSourceList="form.data_source_content" @url_event="url_event"></model-text>
</template>
<template v-else-if="item.key == 'img'">
<model-image :propValue="item.com_data" :propSourceList="form.data_source_content" @url_event="url_event"></model-image>
<model-image :propkey="propkey" :propValue="item.com_data" :propSourceList="form.data_source_content" @url_event="url_event"></model-image>
</template>
<template v-else-if="item.key == 'auxiliary-line'">
<model-lines :propValue="item.com_data" :propSourceList="form.data_source_content"></model-lines>
<model-lines :propkey="propkey" :propValue="item.com_data" :propSourceList="form.data_source_content"></model-lines>
</template>
<template v-else-if="item.key == 'icon'">
<model-icon :propValue="item.com_data" :propSourceList="form.data_source_content" @url_event="url_event"></model-icon>
<model-icon :propkey="propkey" :propValue="item.com_data" :propSourceList="form.data_source_content" @url_event="url_event"></model-icon>
</template>
</view>
</view>

View File

@ -20,6 +20,10 @@
default: () => {
return {};
},
},
propkey: {
type: String,
default: '',
}
},
data() {
@ -28,6 +32,14 @@
com_style: '',
};
},
watch: {
propkey(val) {
this.setData({
form: this.propValue,
});
this.init();
}
},
created() {
this.setData({
form: this.propValue,

View File

@ -24,6 +24,10 @@
return {};
},
},
propkey: {
type: String,
default: '',
}
},
data() {
return {
@ -33,6 +37,14 @@
border_style: '',
};
},
watch: {
propkey(val) {
this.setData({
form: this.propValue,
});
this.init();
}
},
created() {
this.setData({
form: this.propValue,

View File

@ -10,6 +10,10 @@
return {};
},
required: true,
},
propkey: {
type: String,
default: '',
}
},
data() {
@ -18,6 +22,14 @@
border_style: '',
};
},
watch: {
propkey(val) {
this.setData({
form: this.propValue,
});
this.init();
}
},
created() {
this.setData({
form: this.propValue,

View File

@ -27,6 +27,10 @@
default: () => {
return {};
},
},
propkey: {
type: String,
default: '',
}
},
data() {
@ -37,6 +41,14 @@
com_style: '',
};
},
watch: {
propkey(val) {
this.setData({
form: this.propValue,
});
this.init();
}
},
created() {
this.setData({
form: this.propValue,