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

昆明网站建设要多少钱辽宁省建设工程造价管理网站

昆明网站建设要多少钱,辽宁省建设工程造价管理网站,动漫制作专业相近专业,天津建设工程计价网站想写一个系统&#xff0c;对八字进行标注&#xff0c;比如格局&#xff0c;有些八字就有很多格局&#xff0c;于是就想着使用el-tag但是&#xff0c;form表单中如何处理呢&#xff1f; 这个时候&#xff0c;就需要自己写一个,modelValue是表单的默认属性 <template><…

想写一个系统,对八字进行标注,比如格局,有些八字就有很多格局,于是就想着使用el-tag但是,form表单中如何处理呢?
1
这个时候,就需要自己写一个,modelValue是表单的默认属性

<template><div><el-tag v-for="(item,index) in keywordTags" :key="index" closable @close="handleClose(tag)"size="small" class="mx-1">{{item}}</el-tag><el-input v-if="inputVisible" ref="InputRef" v-model="inputValue" class="ml-1 w-20" size="small" @keyup.enter="handleInputConfirm" @blur="handleInputConfirm"></el-input><el-button v-else class="button-new-tag ml-1" size="small" @click="showInput">+ 新增</el-button></div>
</template>
<script lang="ts" setup>
const inputVisible = ref(false)
import { nextTick,ref,watch,getCurrentInstance } from 'vue'
import type { FormInstance, FormRules,ElInput  } from 'element-plus'
const { proxy }: any = getCurrentInstance();
const emits = defineEmits(['update:modelValue'])
const props = defineProps<{modelValue:String,}>()
const keywordTags = ref([])
const inputValue = ref('')
const InputRef = ref<InstanceType<typeof ElInput>>()
const showInput  = () =>{inputVisible.value = truenextTick(() => {InputRef.value!.input!.focus()})
}
const handleClose = (tag:String) => {keywordTags.value.splice(keywordTags.value.indexOf(tag),1)
}
const handleInputConfirm = () => {if (inputValue.value) {keywordTags.value.push(inputValue.value)}inputVisible.value = falseinputValue.value = ''
}   
watch(()=>keywordTags,(newVal,oldVal)=>{if (!proxy.$_.isEmpty(newVal.value)){console.log(newVal.value.join(','))emits('update:modelValue',newVal.value.join(','))}
},{immediate:true,deep:true})
watch(()=>props.modelValue,(newVal,oldVal)=>{if (!proxy.$_.isEmpty(newVal)){keywordTags.value = newVal.split(',')}
},{immediate:true,deep:true})
</script>
<style lang="less" scoped>
.w-20{width: 50px;
}
.mx-1{margin-right: 10px;
}
</style>
</style>

使用的话参见,这样保存和编辑就很容易了。

<el-form-item label="标签" prop="tags"><udf-tags v-model="form.tags"></udf-tags>
</el-form-item>
http://www.yayakq.cn/news/793979/

相关文章:

  • ps网站怎么做超链接手机淘宝官网
  • 网站设计大概收费范围旅行社网站建设设计公司哪家好
  • 网站推广策略ppt收到网站打入0.1元怎么做分录
  • 哪家网站做公司最好ks免费刷粉网站推广低价
  • 网站备案要注意什么怎样创网站
  • 外贸公司如何做网站小程序开发教程推荐
  • 济宁梵盛科技网站建设网站开发 青岛
  • 新建的网站 找不到了wordpress集团网站
  • 网站建设与营销服务微信公众平台开发者
  • 山东东成建设咨询有限公司网站邦泽网站建设
  • 网站 公司形象wordpress主页不显示
  • 网站安全建设方案需求分析免费下载歌曲的网站
  • 高邑做网站中企动力 网站建设 眼镜
  • 频繁从一个网站链接到另一个网站会影响百度收录么山东省住房和城乡建设厅官网二建报名
  • 长春整站优化什么是网络营网络营销的特点
  • 可拖拽式网站建设我的钢铁网网站架构
  • 手机怎么创网站官方网站建设的重要性
  • 天津网站建设推广做物流的网站
  • 三网合一网站建设全包费用婚恋网站建设成本
  • 微擎微网站开发网站建设行业背景
  • 木蚂蚁网站正在建设中注册商标名字
  • 网站轮播图制作网站建设属于无形资产吗
  • 一站式网站管家wordpress 文章格式
  • 咸阳网站建设专业公司一链一网一平台
  • 有什么做数据的网站国外开源商城系统
  • 五个常见的电子商务网站网址seo静态页源码
  • 怎么跟客户介绍网站建设广东公共广告20120708
  • 如何做网站站内搜索代码惠州网站建设多少钱
  • 建设手机网站费用吗六感程序网站建设
  • 国内优秀网站网址天津新亚太工程建设监理有限公司网站