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

建网站浩森宇特wordpress contactform

建网站浩森宇特,wordpress contactform,湖南彩票网站开发,深圳网站工作室需求&#xff1a;一个输入框字段需要支持多次输入&#xff0c;最后传输给后台的字段值以逗号分割 解决方案&#xff1a;结合了el-tag组件的动态编辑标签 那块的代码 //子组件 <template><div class"input-multiple-box" idinputMultipleBox><div>…

需求:一个输入框字段需要支持多次输入,最后传输给后台的字段值以逗号分割
解决方案:结合了el-tag组件的动态编辑标签 那块的代码

//子组件
<template><div class="input-multiple-box" id='inputMultipleBox'><div><el-tag v-for="(tag, index) in inputTagList" :key="index" type="info" closable @close="handleClose(index)">{{ tag }}</el-tag></div><el-inputv-model="inputValue"@keyup.enter="handleInputConfim"@blur="handleInputConfim"style="flex: 1; min-width: 100px"placeholder="按下enter键或者失去焦点进行添加"></el-input></div>
</template><script lang="ts" setup>
import { onMounted, ref, watch } from 'vue'const props = defineProps(["inputTags", "separator"]);
const emit = defineEmits(['update:inputTags'])const inputTagList = ref([])
const inputValue = ref('')
const handleClose = (index: number) => {inputTagList.value.splice(index, 1)emit('update:inputTags', inputTagList.value.join(props.separator || ','))
}
const handleInputConfim = () => {if (inputValue.value) {inputTagList.value.push(inputValue.value)inputValue.value = ''emit('update:inputTags', inputTagList.value.join(props.separator || ','))}
}watch(()=>props.inputTags, (val, pre) => {inputTagList.value = props.inputTags.split(props.separator || ',')
});onMounted(() => {if (props.inputTags) {inputTagList.value = props.inputTags.split(props.separator || ',')}
})
</script><style lang="scss" scoped>
.input-multiple-box {width: 100%;border-radius: 4px;border: 1px solid #dcdfe6;// padding: 0 5px;display: flex;flex-wrap: wrap;
}
</style>
<style lang="scss">
#inputMultipleBox {.el-input__inner {border: none;}
}
</style>//父组件
import multipleInput from '@/components/multipleInput/index.vue'
<multipleInputv-model:inputTags="form.modbus"placeholder="请输入"clearable></multipleInput>

实现效果图
在这里插入图片描述

http://www.yayakq.cn/news/294339/

相关文章:

  • 做英语阅读的网站网站准确的定位
  • 目前会展相关网站的建设情况没有网站怎么快速做cps
  • 呼和浩特市网站中文wordpress 主题下载
  • 网站备案期限怎么自己开发一个app软件
  • 郑州微信网站开发企业宣传册封面素材
  • 商城网站开发的目的和意义广告设计公司招聘信息
  • linux做网站要求主流电商平台有哪些
  • 中国网站建设服务中心怎样加入58同城平台服务行业
  • 品牌网站制作流程360指数官网
  • 网站报价表对比表怎么做龙岗外贸网站建设公司价格
  • 做印刷的网站好用的网站后台管理系统
  • 公司网站案例展示网站开发参考资料
  • 杭州制作企业公司网站网站 多个ip 备案
  • 安徽省建设厅网站备案苏州网站建设网络
  • 摄影设计素材qq群排名优化软件官网
  • 如何用vps建网站音乐网站模板下载
  • 广州网站建设studstu国内域名注册商
  • c语言做项目网站分销系统商城
  • 上海网站开发设计公司在微信中做网站
  • 谁能给我一个网站网站建设行业有什么认证吗
  • 网站用什么字体企业门户网站属于什么层
  • 制作网站软件作品微信腾讯会议
  • 手机端网站建设的费用清单wordpress 表情插件
  • 学生个人网站建设方案书框架栏目舆情分析招聘
  • 网站怎么定位wordpress wp
  • 网站建设的维护与更新朝阳区seo技术
  • 微信分销网站建设价格国家住房与城乡建设部网站首页
  • 绿色系的网站众意网站建设zyecn
  • 在线生成个人网站app中国建盏品牌形象设计大赛
  • 网站在建设中是什么意思青木源网站建设公司