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

柳州做网站的公司有哪些在线生成个人网站免费

柳州做网站的公司有哪些,在线生成个人网站免费,快速做网站的软件,大连个人做网站一、最终效果 二、参数配置 1、代码示例 <t-select-icon v-model"selectVlaue" />2、配置参数&#xff08;Attributes&#xff09;继承 el-input Attributes 参数说明类型默认值v-model绑定值string-prefixIcon输入框前缀iconstringSearchisShowSearch是否显…

一、最终效果

在这里插入图片描述

二、参数配置

1、代码示例

<t-select-icon v-model="selectVlaue" />

2、配置参数(Attributes)继承 el-input Attributes

参数说明类型默认值
v-model绑定值string-
prefixIcon输入框前缀iconstringSearch
isShowSearch是否显示搜索图标Booleantrue
isShowIcon是否显示选中后的图标Booleantrue
selectBindAttributesselectBind"prefix-icon": props.prefixIcon, placeholder: "请选择图标",dialogTitle:'请选择图标',clearable: true,width: "50%"

3、events

事件名说明返回值
select选择完图标返回选中的图标name

三、源码

<template><div class="t_select_icon"><el-inputref="inputRef"v-model="valueIcon"v-bind="attrs"@clear="clearIcon"@click="() => {;(dialogVisible = true), (inputValue = '')}"><template #append v-if="isShowIcon"><el-button :icon="customIcons[modelValue]" /></template></el-input><el-dialog v-model="dialogVisible" :title="attrs.dialogTitle" draggable :width="attrs.width"><el-inputv-model="inputValue"v-if="isShowSearch":placeholder="attrs.searchPlaceholder"clearable:prefix-icon="Icons.Search"/><el-scrollbar v-if="Object.keys(iconsList).length"><div class="icon-list"><divv-for="item in iconsList":key="item"class="icon-item":class="{ 'icon-active': item.name == valueIcon }"@click="selectIcon(item)"><component :is="item"></component><span>{{ item.name }}</span></div></div></el-scrollbar><el-empty :description="attrs.emptyDescription" v-else /></el-dialog></div>
</template><script setup lang="ts" name="TSelectIcon">
import { ref, computed, useAttrs } from "vue"
import * as Icons from "@element-plus/icons-vue"const props = defineProps({modelValue: {type: String,default: ""},prefixIcon: {type: String,default: "Search"},selectBind: Object,isShowSearch: {type: Boolean,default: true},isShowIcon: {type: Boolean,default: true}
})
const emit = defineEmits(["update:modelValue", "select"])
// v-model简写
let valueIcon = computed({get() {return props.modelValue},set(val) {// console.log("v-model简写", val);emit("update:modelValue", val)}
})
const $attrs: any = useAttrs()
const attrs = computed(() => {const selectBind = {"prefix-icon": customIcons[props.prefixIcon],placeholder: "请选择图标",dialogTitle: "请选择图标",searchPlaceholder: "搜索图标",emptyDescription: "未搜索到您要找的图标",clearable: true,width: "50%",...props.selectBind}return { ...$attrs, ...selectBind }
})
// open Dialog
const dialogVisible = ref(false)// 选择图标
const selectIcon = (item: any) => {dialogVisible.value = falsevalueIcon.value = item.nameemit("update:modelValue", item.name)emit("select", item.name)
}// 清空图标
const inputRef = ref()
const clearIcon = () => {valueIcon.value = ""emit("update:modelValue", "")setTimeout(() => inputRef.value.blur(), 0)
}// 监听搜索框值
const inputValue = ref("")
const customIcons: { [key: string]: any } = Icons
const iconsList = computed((): { [key: string]: any } => {if (!inputValue.value) return Iconslet result: { [key: string]: any } = {}for (const key in customIcons) {if (key.toLowerCase().indexOf(inputValue.value.toLowerCase()) > -1)result[key] = customIcons[key]}return result
})
</script><style scoped lang="scss">
.t_select_icon {width: 100%;.el-button {display: flex;align-items: center;justify-content: center;font-size: 18px;color: var(--el-text-color-regular);:deep(.el-icon) {color: var(--el-color-primary);}}:deep(.el-dialog__body) {padding: 25px 20px 20px;.el-input {margin-bottom: 10px;}.icon-list {display: grid;grid-template-columns: repeat(auto-fill, 115px);justify-content: space-evenly;max-height: 60vh;.icon-item {display: flex;flex-direction: column;align-items: center;width: 42px;padding: 20px 30px;cursor: pointer;transition: all 0.2s;svg {width: 30px;height: 30px;}&:hover {transform: scale(1.3);}&.icon-active {color: var(--el-color-primary);}span {margin-top: 5px;line-height: 20px;text-align: center;}}}}
}
</style>

六、组件地址

gitHub组件地址

gitee码云组件地址

七、相关文章

基于ElementUi&antdUi再次封装基础组件文档


vue3+ts基于Element-plus再次封装基础组件文档

http://www.hkea.cn/news/339907/

相关文章:

  • 公司网站制作设谷歌seo是什么职业
  • 北京品牌高端网站建设公司燕郊今日头条
  • 网站制作公司徐州宁波网站seo哪家好
  • 做网站基本费用大概需要多少全媒体运营师报考官网在哪里
  • 网站建设款属于什么科目营业推广策划
  • 建设网站查证书网络广告有哪些形式
  • 分布式网站开发网络销售平台排名
  • 网站建设模板购买品牌seo培训
  • 深圳网站建设 cms网站推广交换链接
  • 标准物质网站建设5118站长工具箱
  • 做一个能注册用户的网站网络推广费用大概价格
  • 网站建设评价东莞谷歌推广
  • php网站后台进不去百度推广入口官网
  • 个人网站一键生成免费推广网站有哪些
  • 厦门做网站设计电商seo优化
  • wordpress视频点播seo技术是干什么的
  • 网站推广是怎么做的网络营销专业如何
  • 平面设计线上兼职上海网站seo
  • 个性化网站定制价格今日热点
  • 做网站的艰辛免费个人网站申请
  • 网站改版需要多久网站设计与制作毕业论文范文
  • 深圳横岗网站建设网站建设的推广渠道
  • 有没有什么网站免费做名片2023年新闻小学生摘抄
  • 新网金商网站外链查询工具
  • 网站建设的进度竞价托管选择微竞价
  • 网站快速网站推广怎么做一个公司网站
  • 旅游网站模板htmlseo品牌优化整站优化
  • 方圆网站建设aso优化重要吗
  • 做购实惠网站的意义好用的搜索引擎有哪些
  • 怎么把自己笔记本做服务器做个网站搭建网站基本步骤