-
安装依赖
- 安装React:
npm install react - 安装Kitsune:
npm install kitsune - 安装额外依赖(如react-dom和ts-xdsl):
npm install react-dom @types/react @types/xdsl
- 安装React:
-
创建项目并安装Kitsunebi
- 创建项目文件(如package.json)。
- 在项目根目录下,创建一个Kitsunebi项目文件。
- 在package-lock.json中添加Kitsunebi到项目依赖中:
"dependencies": { "@types/react": {}, "kitsune": {}, "kitsunebi": {}, "react-dom": {}, "@types/react": {}, "ts-xdsl": {}, } - 使用
npm install安装Kitsunebi。
-
启动Kitsune
- 调用
npx kitsune启动Kitsune。 - 安装Kitsune的组件时,确保自动安装
kitsune/kitsunejs。
- 调用
-
配置启动器
- 如果项目使用启动器,添加一个
KitsuneTab启动器:export const KitsuneTab = { init: () => { const tab = React tab(); tab.kitsune.init({ name: 'parent', components: { ktsune: { tab: 'ktsune-bi-parent' } } }); } };
- 如果项目使用启动器,添加一个
-
配置项目
- 在
index.ts或app.ts中导入KitsuneTab:import KtsuneTab from '@kitsune/kitsune-bi';
- 在项目中注册
KtsuneTab组件:import KtsuneTab from '@kitsune/kitsune-bi'; React.use(KtsuneTab.init)
- 在
-
启动项目
- 在项目启动时,使用
KtsuneTab.init()。 - 在项目中使用
KtsuneTab时,确保项目支持启动器:const app = { init: () => React.use(KtsuneTab.init), };
- 在项目启动时,使用
-
配置项目布局
- 在项目中使用
Kitsune组件,如KtsuneTab配置项目布局:const layout = { name: 'parent', path: './app', files: ['app.ts', 'index.ts'], }; - 使用
Kitsune组件:const app = React.use((_, props) => { React.use(KitsuneTab.init({ layout: layout, })); });
- 在项目中使用
-
使用Kitsunebi
- 在项目中使用
Kitsunebi,例如在index.ts中:const app = { init: () => React.use(KtsuneTab.init({ components: { ktsune: { tab: 'ktsune-bi-parent' } }) }), };
- 在项目中使用
-
跨平台和跨浏览器支持
- 在启动器中设置平台信息:
const KtsuneTab = { init: () => { React.use(KtsuneTab.init({ platforms: { 'web': { platform: React.Platform, }, }, responsive: true, })), }; }; - 在项目中使用
@platform属性。
- 在启动器中设置平台信息:
-
集成其他插件
- 在插件库中添加
kitsunebi:import 'kitsunebi/kitsunebi'; import '@kitsune/kitsune'; import React from 'react'; React.use(() => { const Kts = { init: () => React.use(KitsuneTab.init({ components: { ktsune: { tab: 'ktsune-bi-parent' } } })), }); });
- 在插件库中添加
-
扩展功能
- 支持跨项目支持:使用
@project和@project/配置。 - 支持跨浏览器:使用
@platform和@platform-browser配置。
- 支持跨项目支持:使用
通过以上步骤,可以逐步学习和配置Kitsunebi,使项目在不同平台和浏览器中能够同时显示。



