Skip to content

Commit

Permalink
更新ma-color-picker
Browse files Browse the repository at this point in the history
  • Loading branch information
jujijigo authored Jan 18, 2024
1 parent c8b8890 commit 610df13
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions src/components/ma-colorPicker/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,28 @@
</a-input-group>
</template>
<script setup>
import { ref, watch, reactive, onMounted } from 'vue'
import { reactive, computed } from 'vue'
import { ColorPicker } from 'vue-color-kit'
import 'vue-color-kit/dist/vue-color-kit.css'
import { generate, getRgbStr } from '@arco-design/color'
import useClipboard from 'vue-clipboard3'
import { Message } from '@arco-design/web-vue'
const val = ref()
const props = defineProps({
modelValue: String,
placeholder: { type: String, default: '请选择颜色' },
})
onMounted(() => {
val.value = props.modelValue
})
const emit = defineEmits(['update:modelValue'])
const val = computed({
get() {
return props.modelValue
},
set(newVal) {
emit('update:modelValue', newVal)
}
}
)
const selectColor = (color) => {
val.value = color.hex
Expand All @@ -57,10 +63,4 @@ const defaultColorList = reactive([
'#86909c', '#6d4c41',
])
const emit = defineEmits(['update:modelValue'])
watch(
() => val.value,
vl => emit('update:modelValue', vl)
)
</script>

0 comments on commit 610df13

Please sign in to comment.