mirror of
https://github.com/pure-admin/vue-pure-admin.git
synced 2026-02-13 17:30:27 +08:00
2 lines
950 B
JavaScript
2 lines
950 B
JavaScript
import{v as c,f as t,a as s,h as o,F as i,H as r,l as m}from"./index-LDZGYJqY.js";import{t as p}from"./data-AtTcUaiG.js";function g(){const l=m(""),n=c(()=>p.filter(e=>!l.value||e.name.toLowerCase().includes(l.value.toLowerCase()))),u=(e,a)=>{r(`您修改了第 ${e} 行,数据为:${JSON.stringify(a)}`,{type:"success"})},d=(e,a)=>{r(`您删除了第 ${e} 行,数据为:${JSON.stringify(a)}`)};return{columns:[{prop:"date",headerSlot:"nameHeader"},{label:"姓名",prop:"name"},{label:"地址",prop:"address"},{align:"right",headerRenderer:()=>t(s("el-input"),{modelValue:l.value,"onUpdate:modelValue":e=>l.value=e,size:"small",clearable:!0,placeholder:"Type to search"},null),cellRenderer:({index:e,row:a})=>t(i,null,[t(s("el-button"),{size:"small",onClick:()=>u(e+1,a)},{default:()=>[o("Edit")]}),t(s("el-button"),{size:"small",type:"danger",onClick:()=>d(e+1,a)},{default:()=>[o("Delete")]})])}],filterTableData:n}}export{g as useColumns};
|