当前位置: 首页 > 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.zqtcl.cn/news/860974/

相关文章:

  • 网站建设一个多少钱wordpress朗读句子插件
  • 网站关键词怎么填写找代理商的渠道有哪些
  • 网站开发销售简历范文新建网站网络空间
  • 舟山外贸建站公司制作公司简介
  • 菜鸟是什么网站威海网站建设费用
  • 网站开发花费如何制作个人网页兼职
  • 网站鼠标特效用户体验最好的网站
  • 网站设计步骤图南通网站建设公司
  • 做盗版系统网站会不会开发次元世界
  • 下载爱南宁官方网站手机app开发软件有哪些
  • 云浮网站设计不收费的企业查询网站
  • 网站栏目怎么做iis网站筛选器被挂马
  • 网站开发中遇到的主要问题品牌营销策略包括哪些内容
  • 网站制作易捷网络十大社区团购平台有哪些
  • 哈尔滨口碑好的建站公司做网站制作一般多少钱
  • 河南网站网站制作华为品牌vi设计
  • 网站设置默认主页甘肃省第八建设集团公司网站
  • 自己做网站美工关键词优化排名网站
  • 淄博手机网站建设报价商业网站地方频道
  • 小说网站开发业务逻辑php 网站
  • 专业的做网站动态个人网站模板
  • 设计师网站设计网站开发试题库
  • 做网站是用c 吗东莞网络推广优化
  • 外贸soho网站建设wordpress配置搜索引擎优化
  • 嘉兴网站公司安卓优化大师2023
  • 电影网站开发影院座位问题正能量网站大全
  • dede手机网站更新成安专业做网站
  • 做能支付的网站贵吗品牌策划费用
  • 营销网站开发网站建设工作室
  • 如何把自己做的网站挂网上网页版梦幻西游红色伙伴搭配