修改为空时的报错问题
parent
457babc678
commit
ed15a6b570
|
|
@ -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 modelImage from '@/components/diy/modules/custom/model-image.vue';
|
||||||
import modelIcon from '@/components/diy/modules/custom/model-icon.vue';
|
import modelIcon from '@/components/diy/modules/custom/model-icon.vue';
|
||||||
import modelPanel from '@/components/diy/modules/custom/model-panel.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 {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
modelText,
|
modelText,
|
||||||
|
|
@ -112,7 +112,7 @@ export default {
|
||||||
watch: {
|
watch: {
|
||||||
propKey(val) {
|
propKey(val) {
|
||||||
// 初始化
|
// 初始化
|
||||||
this.init();
|
this.init(this.propCustomList);
|
||||||
},
|
},
|
||||||
propCustomList(val) {
|
propCustomList(val) {
|
||||||
this.init(val);
|
this.init(val);
|
||||||
|
|
@ -173,6 +173,10 @@ export default {
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
async init(val) {
|
async init(val) {
|
||||||
|
// 如果为空就不进行渲染
|
||||||
|
if (isEmpty(val)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
await this.get_custom_width();
|
await this.get_custom_width();
|
||||||
this.set_new_list(val);
|
this.set_new_list(val);
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -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 modelIcon from '@/components/diy/modules/custom/model-icon.vue';
|
||||||
import modelPanel from '@/components/diy/modules/custom/model-panel.vue';
|
import modelPanel from '@/components/diy/modules/custom/model-panel.vue';
|
||||||
import modelCustomGroup from '@/components/diy/modules/custom/model-custom-group.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 {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
modelText,
|
modelText,
|
||||||
|
|
@ -123,7 +123,7 @@ export default {
|
||||||
watch: {
|
watch: {
|
||||||
propKey(val) {
|
propKey(val) {
|
||||||
// 初始化
|
// 初始化
|
||||||
this.init();
|
this.init(this.propCustomList);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
|
@ -177,12 +177,16 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.init();
|
this.init(this.propCustomList);
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
async init() {
|
async init(val) {
|
||||||
|
// 如果为空就不进行渲染
|
||||||
|
if (isEmpty(val)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
await this.get_custom_width();
|
await this.get_custom_width();
|
||||||
this.set_new_list(this.propCustomList);
|
this.set_new_list(val);
|
||||||
},
|
},
|
||||||
get_custom_width() {
|
get_custom_width() {
|
||||||
// 获取当前容器的宽度
|
// 获取当前容器的宽度
|
||||||
|
|
|
||||||
|
|
@ -173,10 +173,6 @@
|
||||||
swiper_bg_style: this.get_swiper_bg_style(new_content, 0),
|
swiper_bg_style: this.get_swiper_bg_style(new_content, 0),
|
||||||
swiper_bg_img_style: this.get_swiper_bg_img_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点击
|
// tab点击
|
||||||
tabs_click_event(tabs_id, is_micro_page) {
|
tabs_click_event(tabs_id, is_micro_page) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue