说明

基于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>
    

声明

作者: liyao

版权:本博客所有文章除特别声明外,均采用CCBY-NC-SA4.O许可协议。转载请注明!

最后更新于 2025-09-30 20:31 history