<span class="color-selector"
v-for="color,index in colors"
:style="{backgroundColor: color}"
@click="activeColorIndex=index;show=true;"
/>
<date-picker
v-model="date"
:color="colors[activeColorIndex]"
:show="show"
@close="show=false"
/>
data() {
return {
date: '',
show: false,
colors: ['#5c6bc0', '#e91e63', '#7b1fa2', '#1e88e5', '#03a9f4', '#00acc1', '#ff9800', 'dimgray'],
activeColorIndex: 0,
}
}