mirror of
https://github.com/palxiao/poster-design.git
synced 2025-07-15 16:02:19 +08:00
fix: colorpick initialize
This commit is contained in:
parent
6fa5d35364
commit
3ef32e2007
@ -65,9 +65,7 @@ let first = true
|
|||||||
// })
|
// })
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
if (props.modelValue) {
|
checkColorLength()
|
||||||
state.innerColor = props.modelValue + (props.modelValue.length === 7 ? 'ff' : '')
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
|
|
||||||
const dropColor = async (color: string) => {
|
const dropColor = async (color: string) => {
|
||||||
@ -90,6 +88,7 @@ watch(
|
|||||||
() => props.modelValue,
|
() => props.modelValue,
|
||||||
(val) => {
|
(val) => {
|
||||||
val !== state.innerColor && (state.innerColor = val)
|
val !== state.innerColor && (state.innerColor = val)
|
||||||
|
checkColorLength()
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -105,12 +104,12 @@ const onChange = () => {
|
|||||||
emit('finish', state.innerColor)
|
emit('finish', state.innerColor)
|
||||||
}
|
}
|
||||||
|
|
||||||
// const addHistory = debounce(300, false, async (value) => {
|
function checkColorLength() {
|
||||||
// store.dispatch('pushColorToHistory', value)
|
if (!props.modelValue) {
|
||||||
// })
|
return
|
||||||
// const colorChange = debounce(150, false, async (e) => {
|
}
|
||||||
// state.innerColor = e + (e.length === 7 ? 'ff' : '')
|
state.innerColor = props.modelValue + (props.modelValue.length === 7 ? 'ff' : '')
|
||||||
// })
|
}
|
||||||
|
|
||||||
const inputBlur = (color: string) => {
|
const inputBlur = (color: string) => {
|
||||||
state.innerColor = color
|
state.innerColor = color
|
||||||
|
Loading…
x
Reference in New Issue
Block a user