当前位置: 首页 > news >正文

郑州专门做网站类似淘宝的网站怎么做的

郑州专门做网站,类似淘宝的网站怎么做的,做网站公司怎么赚钱,服装在线设计平台Vue3 select循环多个#xff0c;选项option不能重复被选 环境#xff1a;vue3tsviteelement plus 实现目标#xff1a;Vue3 select循环多个#xff0c;当其中一个option值被选后#xff0c;其他select里面不能再重复选择该option值。第二种#xff0c;当其中一个option值…Vue3 select循环多个选项option不能重复被选 环境vue3tsviteelement plus 实现目标Vue3 select循环多个当其中一个option值被选后其他select里面不能再重复选择该option值。第二种当其中一个option值被选后其他select里面就不出现被选option的值 第一种代码如下 templatedivformtabletrtd v-for(option, index) in 4 :keyindexel-select v-modelselectedOptions[index] placeholder请选择 changehandleSelectChange(index) clearableel-option v-foritem in optionList :keyitem :labelitem.label :valueitem.value :disabledisOptionDisabled(item.value, index)/el-option/el-select/td/tr/table/form/div /templatescript langts setup import { ref } from vue; import { ElSelect, ElOption } from element-plus;const optionList [{ label: 选项1, value: option1 },{ label: 选项2, value: option2 },{ label: 选项3, value: option3 },{ label: 选项4, value: option4 }, ] const selectedOptionsref(any[,,,]) const handleSelectChange(index: number) {const selectedValue selectedOptions[index];selectedOptions.value.forEach((value:string, i:number) {if (i ! index value selectedValue) {selectedOptions[i] ;}}); } const isOptionDisabled(value: string, currentIndex: number) {return selectedOptions.value.some((selectedValue, index) {return index ! currentIndex selectedValue value;}); } /script 效果 第二种 templatetrtd v-for(option, index) in 3 :keyindexel-select v-modelselectedOptions[index] placeholder请选择 clearableel-option v-foritem in filteredOptions(index) :keyitem.value :labelitem.label :valueitem.value/el-option/el-select/td/tr /templatescript langts import { defineComponent, ref } from vue; import { ElSelect, ElOption } from element-plus;export default defineComponent({components: {ElSelect,ElOption,},setup() {const optionList ref([{ label: 选项1, value: option1 },{ label: 选项2, value: option2 },{ label: 选项3, value: option3 },]);const selectedOptions ref([] as string[]);function filteredOptions(index: number) {const selectedValues selectedOptions.value.filter((value, i) i ! index);return optionList.value.filter(option !selectedValues.includes(option.value));}return {optionList,selectedOptions,filteredOptions,};}, }); /script效果 或者用script setup的写法 script langts setup import { ref } from vue; import { ElSelect, ElOption } from element-plus; const optionList[{ label: 选项1, value: option1 },{ label: 选项2, value: option2 },{ label: 选项3, value: option3 },] const selectedOptions ref([] as string[]) const filteredOptions(index: number) {const selectedValues selectedOptions.value.filter((value, i) i ! index);return optionList.filter(option !selectedValues.includes(option.value)); } /script如果没有使用UI 框架el-select 和el-option标签替换为原生HTML标签即可
http://www.pierceye.com/news/860974/

相关文章:

  • 网站建设公司领导致辞自己可以开发一个软件吗
  • 高端网站设计平台专门做二手书网站或app
  • 系网站建设工作总结大庆建设网站表格下载
  • 免费建站网站seo长春专业网站制作
  • 做网站公司哪家正规公司网站如何更改内容
  • 广州黄埔区建设局网站局wordpress怎么看访问量
  • 佛山找人做网站国家建设免费论文网站
  • 网站内容建设ppt网站建设header
  • 图书馆网站建设费用青海省住房建设厅网站
  • 重庆网站供奉战犯wordpress 关键字链接
  • 给个2021站你们懂得不花钱的深圳手机网站建设
  • 织梦图片自适应网站源码php企业网站源码推荐
  • 网站建网站建设网页微信头像logo在线制作
  • 微网站模板怎么做买了域名如何做网站
  • 新华美玉官方网站在线做维护一个网站要多少钱
  • 网站内容由什么组成部分网页网站设计价格
  • wordpress方框里面打勾两个域名同一个网站做优化
  • 个人怎么做公司网站闲置电脑做网站服务器
  • 有没有什么 网站能够做试卷wordpress写 a href
  • 西安 北郊网站建设网站上传图片加水印
  • 沈阳网站制作哪家好包头爱出行app最新版本
  • 怎么用IP做网站地址网站如何投放广告
  • 试述电子商务网站的建设流程太原建站的模板
  • 微信群投票网站怎么做的企业门户网站怎么做
  • 建网站平台 优帮云嘉兴营销型网站
  • 建筑类专业做教育的网站ui设计app
  • 郑州做营销型网站的公司什么叫社交电商平台
  • 外国做问卷可以赚钱的网站做中国菜的外国网站
  • 青岛市建设厅网站快递网站建设
  • 昆明网站WordPress文章怎么折叠