Files
dsProject/dsBase/WebRoot/html/cdn/lib/components/select-v2/src/util.js
2025-08-14 15:45:08 +08:00

31 lines
639 B
JavaScript

'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var shared = require('@vue/shared');
const flattenOptions = (options) => {
const flattened = [];
options.map((option) => {
if (shared.isArray(option.options)) {
flattened.push({
label: option.label,
isTitle: true,
type: "Group"
});
option.options.forEach((o) => {
flattened.push(o);
});
flattened.push({
type: "Group"
});
} else {
flattened.push(option);
}
});
return flattened;
};
exports.flattenOptions = flattenOptions;
//# sourceMappingURL=util.js.map