UNPKG

el-plus-powerful-table

Version:

## [DOCS](https://peng-xiao-shuai.github.io/vite-vue-admin-docs/zh-CN/component_directive/component/powerful-table-doc.html)

2 lines (1 loc) 1.55 kB
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("vue"),p=require("element-plus"),y=require("./filter.js"),l=require("../../powerful-table/src/powerful-table-data.js"),w=require("../../keys.js"),i=t.defineComponent({name:"PTTags",props:{...l.powerfulTableComponentProp,prop:{type:Object,default:()=>({})}},emits:["return-emit","component-emit"],setup(e,{emit:s}){const o=l.isData({row:e.row,index:e.index,props:e.prop},e.prop.data),f=t.inject(w.SizeSymbol),{REmit:c,event:u}=l.useREmit(s,"tag",{row:e.row,index:e.index,props:e.prop}),m=(r,n)=>r==null?[]:typeof r!="string"?Array.isArray(r)?r.slice(0,n):[r].slice(0,n):r.split(",").slice(0,n);return()=>t.createVNode(t.Fragment,null,[m(e.row[e.prop.prop],(o==null?void 0:o.number)||3).map(r=>t.createVNode(p.ElTag,t.mergeProps({style:{marginRight:"10px",borderColor:typeof(o==null?void 0:o.color)=="function"?"rgba(0,0,0,0)":"auto",...o==null?void 0:o.style},size:f,key:r,type:"primary",color:typeof(o==null?void 0:o.color)=="function"&&(o==null?void 0:o.color(e.row,r))||"",onClick:n=>{n.stopPropagation(),c("click",{row:e.row,index:e.index,prop:e.prop.prop,evt:n}),u("click",n)},onClose:(...n)=>{c("close",...n),u("close",...n)}},l.isProperty({row:e.row,index:e.index,props:e.prop},o==null?void 0:o.property)),{default:()=>[e.prop.filters?typeof e.prop.filters=="function"?e.prop.filters(e.row,e.index):y.filterFun(r,e.prop.filters):r]}))])}});i.install=e=>{e.component(i.name,i)};const g=i;exports.PTTags=g;exports.default=i;