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">
|
<script setup lang="ts">
|
||||||
import {ref} from 'vue';
|
import {ref, watch} from 'vue';
|
||||||
|
|
||||||
const localColor = defineModel<string>();
|
const localColor = defineModel<string>();
|
||||||
|
|
||||||
const menu = ref(false)
|
const menu = ref(false)
|
||||||
|
|
||||||
|
watch(localColor, (newValue) => {
|
||||||
|
if (newValue) {
|
||||||
|
localColor.value = newValue.replace('#', '');
|
||||||
|
}
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<v-menu offset-x :close-on-content-click="false" v-model="menu">
|
<v-menu offset-x :close-on-content-click="false" v-model="menu">
|
||||||
<template v-slot:activator="{ props }">
|
<template v-slot:activator="{ props }">
|
||||||
<v-btn v-bind="props" :color="localColor">
|
<v-btn v-bind="props" :color="`#${localColor}`">
|
||||||
{{ localColor || 'Seleziona un colore' }}
|
{{ `#${localColor}` || 'Seleziona un colore' }}
|
||||||
</v-btn>
|
</v-btn>
|
||||||
</template>
|
</template>
|
||||||
<v-color-picker v-model="localColor" mode="hex"></v-color-picker>
|
<v-color-picker v-model="localColor" mode="hex"></v-color-picker>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue