diff --git a/components/diy/modules/custom/data-group-rendering.vue b/components/diy/modules/custom/data-group-rendering.vue index b28ca0c7..1cfd7126 100644 --- a/components/diy/modules/custom/data-group-rendering.vue +++ b/components/diy/modules/custom/data-group-rendering.vue @@ -26,7 +26,7 @@ import modelLines from '@/components/diy/modules/custom/model-lines.vue'; import modelImage from '@/components/diy/modules/custom/model-image.vue'; import modelIcon from '@/components/diy/modules/custom/model-icon.vue'; import modelPanel from '@/components/diy/modules/custom/model-panel.vue'; -import { location_compute } from '@/common/js/common/common.js'; +import { location_compute, isEmpty } from '@/common/js/common/common.js'; export default { components: { modelText, @@ -112,7 +112,7 @@ export default { watch: { propKey(val) { // 初始化 - this.init(); + this.init(this.propCustomList); }, propCustomList(val) { this.init(val); @@ -173,6 +173,10 @@ export default { }, methods: { async init(val) { + // 如果为空就不进行渲染 + if (isEmpty(val)) { + return; + } await this.get_custom_width(); this.set_new_list(val); }, diff --git a/components/diy/modules/custom/data-rendering.vue b/components/diy/modules/custom/data-rendering.vue index 34ec2373..bb7b69f2 100644 --- a/components/diy/modules/custom/data-rendering.vue +++ b/components/diy/modules/custom/data-rendering.vue @@ -30,7 +30,7 @@ import modelImage from '@/components/diy/modules/custom/model-image.vue'; import modelIcon from '@/components/diy/modules/custom/model-icon.vue'; import modelPanel from '@/components/diy/modules/custom/model-panel.vue'; import modelCustomGroup from '@/components/diy/modules/custom/model-custom-group.vue'; -import { location_compute } from '@/common/js/common/common.js'; +import { location_compute, isEmpty } from '@/common/js/common/common.js'; export default { components: { modelText, @@ -123,7 +123,7 @@ export default { watch: { propKey(val) { // 初始化 - this.init(); + this.init(this.propCustomList); }, }, computed: { @@ -177,12 +177,16 @@ export default { } }, mounted() { - this.init(); + this.init(this.propCustomList); }, methods: { - async init() { + async init(val) { + // 如果为空就不进行渲染 + if (isEmpty(val)) { + return; + } await this.get_custom_width(); - this.set_new_list(this.propCustomList); + this.set_new_list(val); }, get_custom_width() { // 获取当前容器的宽度