From cbdbc95d8cbfcd173dbe95e7eb1f9ce23ce5b0b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=8E=E8=82=96=E7=A3=8A?= <18851179580@163.com> Date: Wed, 16 Oct 2024 12:43:57 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=A1=B5=E9=9D=A2=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/diy/custom.vue | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/components/diy/custom.vue b/components/diy/custom.vue index ab2dc2a7..6b2f1324 100644 --- a/components/diy/custom.vue +++ b/components/diy/custom.vue @@ -88,12 +88,17 @@ export default { init() { const new_form = this.propValue.content; const new_style = this.propValue.style; - const width = sys_width - new_style.common_style.margin_left - new_style.common_style.margin_right; + const { margin_left, margin_right } = new_style.common_style; + const width = sys_width - margin_left - margin_right; + this.$nextTick(() => { + this.setData({ + div_width: width, + scale: width / 390, + }); + }); this.setData({ form: new_form, new_style: new_style, - div_width: width, - scale: width / 390, custom_list_length: new_form.custom_list.length - 1, style_container: common_styles_computer(new_style.common_style) + 'box-sizing: border-box;', // 用于样式显示 style_img_container: common_img_computer(new_style.common_style),