本页导航
article
InputTag
AI摘要
本文介绍了基于Element UI的`el-tag`组件进行封装的`InputTag`组件。文章简要说明了其功能定位,并列出了组件的可选参数与基本使用方法,旨在为用户提供快速上手的指引。
说明
基于el-tag的封装
可选参数
defineProps({
config: {
type: Object as () => {
buttonAttrs: Record<string, any>;
inputAttrs: Record<string, any>;
tagAttrs: Record<string, any>;
},
default: () => ({
buttonAttrs: {}, //可配置 el-button 的所有 props 和自定义属性
inputAttrs: {}, //可配置 el-input 的所有 props 和自定义属性:
tagAttrs: {}, //可配置 el-tag 的所有 props 和自定义属性:
}),
},
});
使用
<script setup lang="ts">
import InputTag from "liyao-vue-common"
const attr = {
buttonAttrs: {
btnText: "新增标签"
}
}
</script>
<template>
<div>
<InputTag :config="attr"></InputTag>
</div>
</template>
最后更新于 2026-02-17 19:41