fix(FE): ColorPickerButton.vue rm '#' from returned value
This commit is contained in:
parent
cd7627b3bb
commit
ae74a76e0c
1 changed files with 9 additions and 5 deletions
|
@ -1,16 +1,20 @@
|
|||
<script setup lang="ts">
|
||||
import {ref} from 'vue';
|
||||
|
||||
import {ref, watch} from 'vue';
|
||||
const localColor = defineModel<string>();
|
||||
|
||||
const menu = ref(false)
|
||||
|
||||
watch(localColor, (newValue) => {
|
||||
if (newValue) {
|
||||
localColor.value = newValue.replace('#', '');
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<v-menu offset-x :close-on-content-click="false" v-model="menu">
|
||||
<template v-slot:activator="{ props }">
|
||||
<v-btn v-bind="props" :color="localColor">
|
||||
{{ localColor || 'Seleziona un colore' }}
|
||||
<v-btn v-bind="props" :color="`#${localColor}`">
|
||||
{{ `#${localColor}` || 'Seleziona un colore' }}
|
||||
</v-btn>
|
||||
</template>
|
||||
<v-color-picker v-model="localColor" mode="hex"></v-color-picker>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue