芝麻web文件管理V1.00
编辑当前文件:/home2/sdektunc/nectar.sdektun.com/assets/DataTable-CZYvSVis.js
import{_ as m,o as s,a as l,b as e,f as n,F as d,g as _,h,r as p,m as k,d as f,w as y}from"./index-Bl6SGUXe.js";const b={data(){return{}},props:{route:{type:Object},items:{type:Array},loading:{type:Boolean}},methods:{linkTo(t){return this.route.path+t},onDelete(t){if(confirm("¿Eliminar elemento?")){const a=this.$push.promise("Eliminando");this.$restapi.delete(this.route.delete+"?idUsuario="+t).then(o=>{a.resolve("Elemento eliminado")}).catch(o=>{a.reject("No se pudo eliminar el elemento")}).finally(o=>{})}}},mounted(){console.log(this.items)}},v={class:"table"},g=e("th",null,"Acciones",-1),w=e("i",{class:"mdi mdi-lead-pencil"},null,-1),C=["onClick"],$=e("i",{class:"mdi mdi-delete"},null,-1),B=[$],D=e("tr",null,[e("td",{colspan:"10"},[e("div",{class:"skeleton table-row"})])],-1),E=e("tr",null,[e("td",{colspan:"10"},[e("div",{class:"skeleton table-row"})])],-1),N=e("tr",null,[e("td",{colspan:"10"},[e("div",{class:"skeleton table-row"})])],-1);function j(t,a,o,T,V,i){const c=p("router-link");return s(),l("table",v,[e("thead",null,[e("tr",null,[n(t.$slots,"header"),g])]),e("tbody",null,[(s(!0),l(d,null,_(o.items,(r,u)=>(s(),l("tr",{key:u},[n(t.$slots,"row",k({ref_for:!0},r)),e("td",null,[n(t.$slots,"update",{},()=>[f(c,{to:i.linkTo("/update/"+r[o.route.primarykey]),class:"link-action link-update"},{default:y(()=>[w]),_:2},1032,["to"])]),n(t.$slots,"delete",{},()=>[e("a",{href:"javascript:",onClick:A=>i.onDelete(r[o.route.primarykey]),class:"link-action link-delete"},B,8,C)])])]))),128)),o.loading?(s(),l(d,{key:0},[D,E,N],64)):h("",!0)])])}const L=m(b,[["render",j]]);export{L as D};