first commit

This commit is contained in:
lingxiao865
2026-02-10 08:05:03 +08:00
commit c5af079d8c
1094 changed files with 97530 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
export function selectComponent(context, selector) {
if (!selector || !context) return;
if (typeof selector === 'function') {
return selector(context);
}
let attribute = selector;
if (attribute.match(/^[^\w]/)) {
attribute = attribute.slice(1);
}
if (
context.$refs && context.$refs[attribute]) {
return context.$refs[attribute];
}
if (context && typeof context.$selectComponent === 'function') {
const res = context.$selectComponent(selector);
return res;
}
return context && context.selectComponent && context.selectComponent(selector);
}