方法一:v-model双向绑定
<ul> <li v-for="(color, index) in colorList"> <el-color-picker v-model="colorObj['val'+index]" @change="changeHandle($event, index)"> </el-color-picker> </li> </ul> //JS代码 export default{ data(){ return{ colorList: ['#409EFF','#f00','#333'], colorObj: {} } }, method:{ changeHandle(color, index){ this.colorList[index] = color; } }, mounted(){ this.colorList.foreach((color,index)=> { this.$set(this.colorObj, 'val'+index, color); }); } }
方法二:value值
<ul>
<li v-for="(color, index) in colorList">
<el-color-picker :value="color" @change="changeHandle($event, index)"></el-color-picker>
</li>
</ul>
//JS代码
export default{
data(){
return{
colorList: ['#111','#222','#333']
}
},
method:{
changeHandle(color, index){
this.colorList[index] = color;
}
}
}
上面是“v-for循环绑定el-color-picker颜色选择器绑定value/v-model值”的全面内容,想了解更多关于 vuejs 内容,请继续关注web建站教程。
当前网址:https://ipkd.cn/webs_2057.html
workflows工作流
一架令人难忘的美丽钢琴ComfyUI工作流
乡村枯树黄花comfyui工作流
一个极其美丽细致的女孩ComfyUI工作流
在森林中心有一座蛇形的房子ComfyUI工作流
一位穿着优雅银色装饰黑色连衣裙的苗条模特
一个黑人在森林中穿着折纸的衣服ComfyUI工作流
一辆机器人虎狮高端混合动力车ComfyUI工作流
一只在星系中漂浮宇宙生物ComfyUI工作流
猜你喜欢
声明:本站提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请发送到邮箱:admin@ipkd.cn,我们会在看到邮件的第一时间内为您处理!

利用CSS3代码编写45款按钮效果
html5如何3D立方体旋转特效
css3做一个风雨雷电天气动态图标
jquery做一个漂亮挂墙动态时钟
纯css制作卡通头像(随鼠标转头)
利用canvas画几个好玩的星云物种
数字滚动效果(兼容IE6/IE8)
canvas经线动画走到效果










