提交 494fb30a 编写于 作者: daluozha's avatar daluozha

chore: add 'active' to color-picker of widgets

上级 13492802
...@@ -61,7 +61,13 @@ ...@@ -61,7 +61,13 @@
class="color-list__item" class="color-list__item"
@click="setWidgetColor(s.widgetType, fillColor)" @click="setWidgetColor(s.widgetType, fillColor)"
> >
<div :style="{ background: fillColor }" class="bg-color" /> <div
:style="{ background: fillColor }"
class="bg-color"
:class="{
active: fillColor === getWidgetColor(s.widgetType),
}"
/>
</li> </li>
</ul> </ul>
</details> </details>
...@@ -204,6 +210,12 @@ function setWidgetColor(widgetType: WidgetType, fillColor: string) { ...@@ -204,6 +210,12 @@ function setWidgetColor(widgetType: WidgetType, fillColor: string) {
}) })
} }
} }
function getWidgetColor(type: string) {
if (type === WidgetType.Tops || type === WidgetType.Clothes) {
return avatarOption.value.widgets[type]?.fillColor
} else return ''
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册