ideaz-element
Version:
<p align="center"> <a href="" target="_blank" rel="noopener noreferrer"> <img src="./docs/public/logo.svg" alt="Ideaz Element" width="180" style="width: 180px;" /> </a> </p>
50 lines (49 loc) • 1.25 kB
JavaScript
import { defineComponent as m, ref as s, computed as g, createVNode as i } from "vue";
import "../../../shared/index.mjs";
import { ElTableColumn as p, ElRadio as f } from "element-plus";
import { radioColumnProps as h } from "./props.mjs";
import { getRowKey as u } from "../../../shared/getRowKey.mjs";
const S = /* @__PURE__ */ m({
name: "ZRadioColumn",
props: h,
emits: ["radio-change"],
setup(l, {
emit: n,
expose: c
}) {
const o = s(""), d = g(() => ({
width: 48,
align: "center",
...l.column
})), r = (e) => {
n("radio-change", e);
};
return c({
clearSelection: () => {
o.value = "", n("radio-change", {});
},
toggleRadioSelection: (e) => {
const {
rowKey: a
} = l.tableProps, t = u(e, a);
o.value = t, r(e);
}
}), () => i(p, d.value, {
default: ({
row: e
}) => {
var a;
return i(f, {
modelValue: o.value,
"onUpdate:modelValue": (t) => o.value = t,
label: u(e, (a = l.tableProps) == null ? void 0 : a.rowKey),
onChange: () => r(e)
}, null);
}
});
}
});
export {
S as default
};
//# sourceMappingURL=RadioColumn.mjs.map