Skip to content

Commit cf67b8c

Browse files
authored
fix(resolver/tdesign): auto import 'DialogPlugin', 'LoadingPlugin', … (#656)
1 parent 416f2c6 commit cf67b8c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/core/resolvers/tdesign.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ export interface TDesignResolverOptions {
2727
}
2828

2929
export function TDesignResolver(options: TDesignResolverOptions = {}): ComponentResolver {
30+
const pluginList = ['DialogPlugin', 'LoadingPlugin', 'MessagePlugin', 'NotifyPlugin']
3031
return {
3132
type: 'component',
3233
resolve: (name: string) => {
@@ -43,8 +44,8 @@ export function TDesignResolver(options: TDesignResolverOptions = {}): Component
4344
}
4445
}
4546

46-
if (name.match(/^T[A-Z]/)) {
47-
const importName = name.slice(1)
47+
if (name.match(/^T[A-Z]/) || pluginList.includes(name)) {
48+
const importName = name.match(/^T[A-Z]/) ? name.slice(1) : name
4849

4950
return {
5051
name: importName,

0 commit comments

Comments
 (0)