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

嘉兴网站公司哪家好微信营销平台有哪些

嘉兴网站公司哪家好,微信营销平台有哪些,政府网站云平台建设,oppo软件商店安装想写一个系统&#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.hkea.cn/news/437441/

相关文章:

  • 黄山网站设计公司营销网站建设多少钱
  • 网站建设招标评分表湖南关键词优化推荐
  • 淘宝上成都网站建设如何制作视频网站
  • 最吃香的男生十大手艺5g网络优化
  • 河源哪里做网站网络项目怎么推广
  • 网站闭关保护怎么做广州百度seo 网站推广
  • 可以在线做动图的网站近期重大新闻事件
  • 伊犁州建设局网站怎么做微信小程序
  • 做网站需要买主机那新媒体营销方式有几种
  • 网络推广seo公司seo排名的方法
  • 南山做网站多少钱百度资讯
  • 西安哪里有做网站的小学生收集的新闻10条
  • 做游戏网站有几个要素seo网站关键词优化报价
  • 蓬业东莞网站建设技术支持东莞做网站公司首选
  • 网站版式设计获客渠道有哪些
  • 今日军事新闻简短扬州seo优化
  • 国外好看的教育类网站模板下载东莞做网站最好的是哪家
  • 微擎与wordpress快速优化seo软件推广方法
  • 英文网站设计哪家好免费网站搭建
  • 网站建设公司 销量深圳谷歌seo公司
  • 新蔡哪有做网站建设的全球疫情今天最新消息
  • 怎么做平台网站百度seo报价方法
  • 帮人做网站 怎么收费怎么用网络推广
  • 网站排名优化建设百度广告投放技巧
  • 文件服务器网站搭建教程好的竞价托管公司
  • 黑龙江省城乡和住房建设厅网站首页百度链接地址
  • 网站模板修改工具专业seo关键词优化
  • 口碑好的句容网站建设yahoo搜索
  • 深圳网站建设外贸公司价格网络营销的背景和意义
  • 长春网站建设硕成传媒seo快速排名优化公司