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)
52 lines (51 loc) • 1.33 kB
JavaScript
import { defineComponent as c, inject as a, createVNode as r, Fragment as u, mergeProps as w } from "vue";
import { ElSwitch as s } from "element-plus";
import { powerfulTableComponentProp as d, useREmit as f, isProperty as h } from "../../powerful-table/src/powerful-table-data.mjs";
import { SizeSymbol as y } from "../../keys.mjs";
const n = /* @__PURE__ */ c({
name: "PTSwitch",
props: {
...d,
prop: {
type: Object,
default: () => ({})
}
},
emits: ["return-emit", "component-emit"],
setup(e, {
emit: i
}) {
const t = e.prop.data, m = a(y), {
REmit: l,
event: p
} = f(i, "switch", {
row: e.row,
index: e.index,
props: e.prop
});
return () => r(u, null, [r(s, w({
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), p("change", ...o);
}
}, h({
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 g = n;
export {
g as PTSwitch,
n as default
};
//# sourceMappingURL=switch.mjs.map