vxe-table-pro
Version:
Vue table plugins based on vxe-table
55 lines (54 loc) • 1.26 kB
JavaScript
import { defineComponent as u, mergeModels as r, useModel as i, onMounted as m, ref as h, resolveComponent as p, createBlock as f, openBlock as k } from "vue";
const g = /* @__PURE__ */ u({
__name: "index",
props: /* @__PURE__ */ r({
getTreeData: {
type: Function,
default: () => {
}
},
childName: {
type: String,
default: "children"
},
label: {
type: String,
default: "label"
}
}, {
modelValue: { default: [] },
modelModifiers: {}
}),
emits: ["update:modelValue"],
setup(e) {
const l = i(e, "modelValue"), c = e;
m(() => {
d();
});
const o = h([]), d = async () => {
const t = await c.getTreeData();
o.value = t;
}, s = (t, n) => {
const a = n.checkedKeys;
l.value = a;
};
return (t, n) => {
const a = p("el-tree");
return k(), f(a, {
style: { "max-width": "600px" },
data: o.value,
"show-checkbox": "",
"node-key": "id",
"default-checked-keys": l.value,
props: {
childName: e.childName,
label: e.label
},
onCheck: s
}, null, 8, ["data", "default-checked-keys", "props"]);
};
}
});
export {
g as default
};