@arco-vue-pro-components/pro-components
Version:
基于@arco-design/web-vue组件的高级组件,包括pro-table
27 lines (26 loc) • 992 B
JavaScript
;
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
var vue = require("vue");
const useRowSelection = ({
selectedKeys,
defaultSelectedKeys,
selected,
defaultSelected,
rowSelection
}) => {
var _a, _b, _c, _d, _e, _f, _g, _h;
const isRadio = vue.computed(() => {
var _a2;
return ((_a2 = rowSelection.value) == null ? void 0 : _a2.type) === "radio";
});
const selectedRowKeys = vue.ref(
(_f = (_e = (_c = (_b = selectedKeys.value) != null ? _b : (_a = rowSelection.value) == null ? void 0 : _a.selectedRowKeys) != null ? _c : defaultSelectedKeys.value) != null ? _e : (_d = rowSelection.value) == null ? void 0 : _d.defaultSelectedRowKeys) != null ? _f : []
);
const selectedRows = vue.ref((_h = (_g = selected.value) != null ? _g : defaultSelected.value) != null ? _h : []);
return {
isRadio,
selectedRowKeys,
selectedRows
};
};
exports.useRowSelection = useRowSelection;