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)
56 lines (55 loc) • 1.41 kB
JavaScript
import { defineComponent as p, inject as a, createVNode as i, Fragment as w, mergeProps as u } from "vue";
import { ElSwitch as d } from "element-plus";
import { powerfulTableComponentProp as s, isData as f, useREmit as h, isProperty as x } from "../../powerful-table/src/powerful-table-data.mjs";
import { SizeSymbol as y } from "../../keys.mjs";
const n = /* @__PURE__ */ p({
name: "PTSwitch",
props: {
...s,
prop: {
type: Object,
default: () => ({})
}
},
emits: ["return-emit", "component-emit"],
setup(e, {
emit: r
}) {
const t = f({
row: e.row,
index: e.index,
props: e.prop
}, e.prop.data), m = a(y), {
REmit: l,
event: c
} = h(r, "switch", {
row: e.row,
index: e.index,
props: e.prop
});
return () => i(w, null, [i(d, u({
size: m,
style: (t == null ? void 0 : t.style) || {},
modelValue: e.row[e.prop.prop],
"onUpdate:modelValue": (o) => e.row[e.prop.prop] = o,
"active-value": "1",
"inactive-value": "0",
onChange: (...o) => {
l("change", ...o), c("change", ...o);
}
}, x({
row: e.row,
index: e.index,
props: e.prop
}, t == null ? void 0 : t.property)), null)]);
}
});
n.install = (e) => {
e.component(n.name, n);
};
const b = n;
export {
b as PTSwitch,
n as default
};
//# sourceMappingURL=switch.mjs.map