Skip to content

Commit 674933a

Browse files
authored
chore: remove all hard code component name (#3445)
1 parent f62681b commit 674933a

File tree

5 files changed

+6
-3
lines changed

5 files changed

+6
-3
lines changed

components/select/index.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -225,8 +225,8 @@ const Select = defineComponent({
225225
/* istanbul ignore next */
226226
Select.install = function(app: App) {
227227
app.component(Select.name, Select);
228-
app.component('ASelectOption', Select.Option);
229-
app.component('ASelectOptGroup', Select.OptGroup);
228+
app.component(Select.Option.displayName, Select.Option);
229+
app.component(Select.OptGroup.displayName, Select.OptGroup);
230230
return app;
231231
};
232232
export default Select as typeof Select &

components/tree-select/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ const TreeSelect = defineComponent({
200200
/* istanbul ignore next */
201201
TreeSelect.install = function(app: App) {
202202
app.component(TreeSelect.name, TreeSelect);
203-
app.component('ATreeSelectNode', TreeSelect.TreeNode);
203+
app.component(TreeSelect.TreeNode.displayName, TreeSelect.TreeNode);
204204
return app;
205205
};
206206

components/vc-select/OptGroup.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,5 @@ export interface OptionGroupFC extends FunctionalComponent<OptGroupProps> {
1111

1212
const OptGroup: OptionGroupFC = () => null;
1313
OptGroup.isSelectOptGroup = true;
14+
OptGroup.displayName = 'ASelectOptGroup';
1415
export default OptGroup;

components/vc-select/Option.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,5 @@ export interface OptionFC extends FunctionalComponent<OptionProps> {
1414

1515
const Option: OptionFC = () => null;
1616
Option.isSelectOption = true;
17+
Option.displayName = 'ASelectOption';
1718
export default Option;

components/vc-tree-select/src/SelectNode.jsx

+1
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,5 @@ function SelectNode(_, { attrs, slots }) {
1111

1212
SelectNode.isTreeNode = true;
1313
SelectNode.inheritAttrs = false;
14+
SelectNode.displayName = 'ATreeSelectNode';
1415
export default SelectNode;

0 commit comments

Comments
 (0)