mirror of
https://github.com/Codennnn/vue-color-avatar.git
synced 2024-12-22 12:02:38 +00:00
Merge pull request #11 from daluozha/luozha/chore_widget_color_active
chore: add 'active' to color-picker of widgets
This commit is contained in:
commit
d05d51627a
@ -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) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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>
|
||||||
|
Loading…
Reference in New Issue
Block a user