修改为空时的报错问题

master
于肖磊 2025-03-04 11:08:44 +08:00
parent 457babc678
commit ed15a6b570
3 changed files with 15 additions and 11 deletions

View File

@ -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);
},

View File

@ -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() {
//

View File

@ -173,10 +173,6 @@
swiper_bg_style: this.get_swiper_bg_style(new_content, 0),
swiper_bg_img_style: this.get_swiper_bg_img_style(new_content, 0),
});
console.log(
app.globalData.px_to_rpx(100)
);
},
// tab
tabs_click_event(tabs_id, is_micro_page) {