chore: remove all hard code component name (#3445)

This commit is contained in:
zkwolf 2020-12-25 13:02:08 +08:00 committed by GitHub
parent f62681b9d4
commit 674933ae60
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 6 additions and 3 deletions

View File

@ -225,8 +225,8 @@ const Select = defineComponent({
/* istanbul ignore next */
Select.install = function(app: App) {
app.component(Select.name, Select);
app.component('ASelectOption', Select.Option);
app.component('ASelectOptGroup', Select.OptGroup);
app.component(Select.Option.displayName, Select.Option);
app.component(Select.OptGroup.displayName, Select.OptGroup);
return app;
};
export default Select as typeof Select &

View File

@ -200,7 +200,7 @@ const TreeSelect = defineComponent({
/* istanbul ignore next */
TreeSelect.install = function(app: App) {
app.component(TreeSelect.name, TreeSelect);
app.component('ATreeSelectNode', TreeSelect.TreeNode);
app.component(TreeSelect.TreeNode.displayName, TreeSelect.TreeNode);
return app;
};

View File

@ -11,4 +11,5 @@ export interface OptionGroupFC extends FunctionalComponent<OptGroupProps> {
const OptGroup: OptionGroupFC = () => null;
OptGroup.isSelectOptGroup = true;
OptGroup.displayName = 'ASelectOptGroup';
export default OptGroup;

View File

@ -14,4 +14,5 @@ export interface OptionFC extends FunctionalComponent<OptionProps> {
const Option: OptionFC = () => null;
Option.isSelectOption = true;
Option.displayName = 'ASelectOption';
export default Option;

View File

@ -11,4 +11,5 @@ function SelectNode(_, { attrs, slots }) {
SelectNode.isTreeNode = true;
SelectNode.inheritAttrs = false;
SelectNode.displayName = 'ATreeSelectNode';
export default SelectNode;