fix
This commit is contained in:
16
src/plugins/kintoneClient.ts
Normal file
16
src/plugins/kintoneClient.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import { type App } from 'vue';
|
||||
import { KintoneRestAPIClient } from '@kintone/rest-api-client';
|
||||
|
||||
// 创建注入的 Symbol(用于类型安全)
|
||||
export const KintoneClientInjectionKey = Symbol('kintone-client');
|
||||
|
||||
// 插件安装函数
|
||||
export const kintoneClientPlugin = {
|
||||
install(app: App) {
|
||||
// 创建客户端实例(不需要参数)
|
||||
const client = new KintoneRestAPIClient();
|
||||
|
||||
// 提供给整个应用使用
|
||||
app.provide(KintoneClientInjectionKey, client);
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user