You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
yanzong/public/assets/u-tag.5476fd14.js

1 lines
2.1 KiB

import{_ as o}from"./u-icon.b463ad8a.js";import{x as e,o as t,c as l,w as s,f as i,t as r,a,l as c,n,e as d,j as u,i as p}from"./index-ae8bbb19.js";import{r as f}from"./uni-app.es.ee1d5b08.js";import{_ as h}from"./_plugin-vue_export-helper.1b428a4d.js";const m=h({name:"u-tag",emits:["click","close"],props:{type:{type:String,default:"primary"},disabled:{type:[Boolean,String],default:!1},size:{type:String,default:"default"},shape:{type:String,default:"square"},text:{type:[String,Number],default:""},bgColor:{type:String,default:""},color:{type:String,default:""},borderColor:{type:String,default:""},closeColor:{type:String,default:""},index:{type:[Number,String],default:""},mode:{type:String,default:"light"},closeable:{type:Boolean,default:!1},show:{type:Boolean,default:!0}},data:()=>({}),computed:{customStyle(){let o={};return this.color&&(o.color=this.color),this.bgColor&&(o.backgroundColor=this.bgColor),"plain"==this.mode&&this.color&&!this.borderColor?o.borderColor=this.color:o.borderColor=this.borderColor,o},iconStyle(){if(!this.closeable)return;let o={};return"mini"==this.size?o.fontSize="20rpx":o.fontSize="22rpx","plain"==this.mode||"light"==this.mode?o.color=this.type:"dark"==this.mode&&(o.color="#ffffff"),this.closeColor&&(o.color=this.closeColor),o},closeIconColor(){return this.closeColor?this.closeColor:this.color?this.color:"dark"==this.mode?"#ffffff":this.type}},methods:{clickTag(){this.disabled||this.$emit("click",this.index)},close(){this.$emit("close",this.index)}}},[["render",function(h,m,y,g,C,b){const S=f(e("u-icon"),o),k=p;return y.show?(t(),l(k,{key:0,class:u([[y.disabled?"u-disabled":"","u-size-"+y.size,"u-shape-"+y.shape,"u-mode-"+y.mode+"-"+y.type],"u-tag"]),style:n([b.customStyle]),onClick:b.clickTag},{default:s((()=>[i(r(y.text)+" ",1),a(k,{class:"u-icon-wrap",onClick:m[0]||(m[0]=c((()=>{}),["stop"]))},{default:s((()=>[y.closeable?(t(),l(S,{key:0,onClick:b.close,size:"22",color:b.closeIconColor,name:"close",class:"u-close-icon",style:n([b.iconStyle])},null,8,["onClick","color","style"])):d("",!0)])),_:1})])),_:1},8,["class","style","onClick"])):d("",!0)}],["__scopeId","data-v-5e1a183f"]]);export{m as _};