Selaa lähdekoodia

fix: 修改容器边框问题

jiaxing.liao 1 kuukausi sitten
vanhempi
commit
f5be6436f1

+ 1 - 1
src/renderer/src/lvgl-widgets/container/style.json

@@ -15,7 +15,7 @@
         },
         "border": {
           "color": "#2092f5ff",
-          "width": 0,
+          "width": 2,
           "radius": 0,
           "side": ["all"]
         },

+ 7 - 0
src/renderer/src/lvgl-widgets/hooks/useWidgetStyle.ts

@@ -273,6 +273,13 @@ export const useWidgetStyle = (param: StyleParam) => {
         part === partItem.name ? state : partItem.stateList?.[0]
       )
 
+      // 排除不需要用预设样式样式选项,[border、outline、shadow]
+      const excludeKeys = ['border', 'outline', 'shadow']
+      excludeKeys.forEach((key) => {
+        delete presetStyle?.[key]
+        delete defaultStyle?.[key]
+      })
+
       // 合并到预设样式
       style = assign({}, presetStyle || {}, defaultStyle || {}, style || {})