From d25084485817a94ded740059293a44d7232c18c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=8E=E8=82=96=E7=A3=8A?= <18851179580@163.com> Date: Fri, 13 Dec 2024 16:52:58 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E9=80=89=E9=A1=B9=E5=8D=A1=E5=92=8C?= =?UTF-8?q?=E8=BD=AE=E6=92=AD=E5=9B=BE=E6=95=B0=E6=8D=AE=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/js/common/common.js | 6 +- .../choice-location/choice-location.vue | 2 +- components/diy/carousel.vue | 58 ++++++++---- components/diy/diy.vue | 67 ++++++++------ components/diy/modules/tabs-view.vue | 89 ++++++++++++++++--- components/diy/search.vue | 2 +- components/diy/tabs-carousel.vue | 50 +++++++++-- components/diy/tabs.vue | 9 +- 8 files changed, 219 insertions(+), 64 deletions(-) diff --git a/common/js/common/common.js b/common/js/common/common.js index d59e391b..246c101f 100644 --- a/common/js/common/common.js +++ b/common/js/common/common.js @@ -32,7 +32,7 @@ export function get_nested_property(obj, path) { // 使用reduce方法遍历属性键数组,逐层访问对象属性 // 如果当前对象存在且拥有下一个属性键,则继续访问;否则返回空字符串 - return keys.reduce((o, key) => (o && o[key] ? o[key] : ''), obj) || ''; + return keys.reduce((o, key) => (o != null && o[key] != null ? o[key] : ''), obj) ?? ''; } /** @@ -344,6 +344,10 @@ export function background_computer(new_style) { * 这些样式包括渐变色、内边距、外边距、圆角和阴影等,为组件提供了一套完整的外观定义。 * * @param new_style 组件的新样式对象,包含了需要计算的样式属性。 + * @param scale 一个缩放比例,用于控制样式的缩放,默认为1。 + * @param scale 用于控制样式的缩放比例,默认为1,表示不进行缩放。 + * @param is_custom 一个布尔值,用于判断是否为自定义样式,默认为false。 + * @param index 用于标识组件的索引,默认为0。 * @returns 返回一个字符串,包含了计算后的样式定义,可以被直接应用于组件的样式属性。 */ export function common_styles_computer(new_style) { diff --git a/components/choice-location/choice-location.vue b/components/choice-location/choice-location.vue index 31c922c6..717572f9 100644 --- a/components/choice-location/choice-location.vue +++ b/components/choice-location/choice-location.vue @@ -10,7 +10,7 @@ - {{ location.text || '' }} + {{ location.text || '' }} diff --git a/components/diy/carousel.vue b/components/diy/carousel.vue index ab77adc0..65c167b4 100644 --- a/components/diy/carousel.vue +++ b/components/diy/carousel.vue @@ -1,6 +1,6 @@