Skip to content

Commit f1fb61d

Browse files
committed
* dtable: support get plugin from dtable component.
1 parent 90a9aa3 commit f1fb61d

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

lib/dtable/src/helpers/shared-plugins.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export function removePlugin(name: string): boolean {
3434
return sharedPlugins.delete(name);
3535
}
3636

37-
function getDTablePlugin(nameOrPlugin: DTablePluginLike): DTablePlugin | undefined {
37+
export function getDTablePlugin(nameOrPlugin: DTablePluginLike): DTablePlugin | undefined {
3838
if (typeof nameOrPlugin === 'string') {
3939
const plugin = sharedPlugins.get(nameOrPlugin);
4040
if (!plugin) {

lib/dtable/src/vanilla/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import {ComponentFromReact, ComponentOptions} from '@zui/core';
22
import {DTable as DTableReact} from '../components/dtable';
3-
import {removePlugin, definePlugin} from '../helpers/shared-plugins';
3+
import {removePlugin, definePlugin, getDTablePlugin} from '../helpers/shared-plugins';
44
import * as plugins from '../plugins';
55
import type {DTableOptions} from '../types/options';
66

@@ -13,6 +13,8 @@ export class DTable extends ComponentFromReact<DTableOptions, DTableReact> {
1313

1414
static removePlugin = removePlugin;
1515

16+
static getPlugin = getDTablePlugin;
17+
1618
static plugins = plugins;
1719

1820
setOptions(options?: Partial<ComponentOptions<DTableOptions>>, reset?: boolean): ComponentOptions<DTableOptions> {

0 commit comments

Comments
 (0)