()=>T` |
+| useStore | 获取可响应式状态 | - |
diff --git a/docs/src/components/introduction.md b/docs/src/components/introduction.md
index 8fc96205a..66e416fbc 100644
--- a/docs/src/components/introduction.md
+++ b/docs/src/components/introduction.md
@@ -1,6 +1,6 @@
# 介绍
-::: tip README
+::: info README
该文档介绍的是框架组件的使用方法、属性、事件等。如果你觉得组件封装的不好,或者不符合你的需求,你可以直接使用原生的组件,或者自己封装一个组件,不需要拘泥于框架提供的组件。我们只是提供了一些常用的组件,方便你快速开发。是否使用,取决于你的需求。
diff --git a/docs/src/demos/vben-drawer/auto-height/drawer.vue b/docs/src/demos/vben-drawer/auto-height/drawer.vue
new file mode 100644
index 000000000..9ab433ccb
--- /dev/null
+++ b/docs/src/demos/vben-drawer/auto-height/drawer.vue
@@ -0,0 +1,45 @@
+
+
+
+
+ {{ item }}
+
+
+
+ 点击更新数据
+
+
+
+
diff --git a/docs/src/demos/vben-drawer/auto-height/index.vue b/docs/src/demos/vben-drawer/auto-height/index.vue
new file mode 100644
index 000000000..59294e538
--- /dev/null
+++ b/docs/src/demos/vben-drawer/auto-height/index.vue
@@ -0,0 +1,21 @@
+
+
+
+
+
+ Open
+
+
diff --git a/docs/src/demos/vben-drawer/basic/index.vue b/docs/src/demos/vben-drawer/basic/index.vue
new file mode 100644
index 000000000..bd7d92750
--- /dev/null
+++ b/docs/src/demos/vben-drawer/basic/index.vue
@@ -0,0 +1,11 @@
+
+
+
+ drawerApi.open()">Open
+ drawer content
+
+
diff --git a/docs/src/demos/vben-drawer/dynamic/drawer.vue b/docs/src/demos/vben-drawer/dynamic/drawer.vue
new file mode 100644
index 000000000..50f628316
--- /dev/null
+++ b/docs/src/demos/vben-drawer/dynamic/drawer.vue
@@ -0,0 +1,26 @@
+
+
+
+
+
+ 内部动态修改标题
+
+
+
+
diff --git a/docs/src/demos/vben-drawer/dynamic/index.vue b/docs/src/demos/vben-drawer/dynamic/index.vue
new file mode 100644
index 000000000..ad7e6565d
--- /dev/null
+++ b/docs/src/demos/vben-drawer/dynamic/index.vue
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+ Open
+
+ 从外部修改标题并打开
+
+
+
diff --git a/docs/src/demos/vben-drawer/extra/drawer.vue b/docs/src/demos/vben-drawer/extra/drawer.vue
new file mode 100644
index 000000000..e84c1939f
--- /dev/null
+++ b/docs/src/demos/vben-drawer/extra/drawer.vue
@@ -0,0 +1,8 @@
+
+
+ extra drawer content
+
diff --git a/docs/src/demos/vben-drawer/extra/index.vue b/docs/src/demos/vben-drawer/extra/index.vue
new file mode 100644
index 000000000..59294e538
--- /dev/null
+++ b/docs/src/demos/vben-drawer/extra/index.vue
@@ -0,0 +1,21 @@
+
+
+
+
+
+ Open
+
+
diff --git a/docs/src/demos/vben-drawer/shared-data/drawer.vue b/docs/src/demos/vben-drawer/shared-data/drawer.vue
new file mode 100644
index 000000000..629199b67
--- /dev/null
+++ b/docs/src/demos/vben-drawer/shared-data/drawer.vue
@@ -0,0 +1,26 @@
+
+
+
+ 外部传递数据: {{ data }}
+
+
diff --git a/docs/src/demos/vben-drawer/shared-data/index.vue b/docs/src/demos/vben-drawer/shared-data/index.vue
new file mode 100644
index 000000000..04885f157
--- /dev/null
+++ b/docs/src/demos/vben-drawer/shared-data/index.vue
@@ -0,0 +1,26 @@
+
+
+
+
+
+
+ Open
+
+
diff --git a/docs/src/demos/vben-modal/auto-height/index.vue b/docs/src/demos/vben-modal/auto-height/index.vue
new file mode 100644
index 000000000..2addf2e90
--- /dev/null
+++ b/docs/src/demos/vben-modal/auto-height/index.vue
@@ -0,0 +1,21 @@
+
+
+
+
+
+ Open
+
+
diff --git a/docs/src/demos/vben-modal/auto-height/modal.vue b/docs/src/demos/vben-modal/auto-height/modal.vue
new file mode 100644
index 000000000..8757d5ef0
--- /dev/null
+++ b/docs/src/demos/vben-modal/auto-height/modal.vue
@@ -0,0 +1,45 @@
+
+
+
+
+ {{ item }}
+
+
+
+ 点击更新数据
+
+
+
+
diff --git a/docs/src/demos/vben-modal/basic/index.vue b/docs/src/demos/vben-modal/basic/index.vue
index 038d62689..9f8997085 100644
--- a/docs/src/demos/vben-modal/basic/index.vue
+++ b/docs/src/demos/vben-modal/basic/index.vue
@@ -5,7 +5,7 @@ const [Modal, modalApi] = useVbenModal();
- modalApi.open()">打开弹窗
- modal content
+ modalApi.open()">Open
+ modal content
diff --git a/docs/src/demos/vben-modal/draggable/index.vue b/docs/src/demos/vben-modal/draggable/index.vue
new file mode 100644
index 000000000..2addf2e90
--- /dev/null
+++ b/docs/src/demos/vben-modal/draggable/index.vue
@@ -0,0 +1,21 @@
+
+
+
+
+
+ Open
+
+
diff --git a/docs/src/demos/vben-modal/draggable/modal.vue b/docs/src/demos/vben-modal/draggable/modal.vue
new file mode 100644
index 000000000..ecca497b1
--- /dev/null
+++ b/docs/src/demos/vben-modal/draggable/modal.vue
@@ -0,0 +1,10 @@
+
+
+ modal content
+
diff --git a/docs/src/demos/vben-modal/dynamic/index.vue b/docs/src/demos/vben-modal/dynamic/index.vue
new file mode 100644
index 000000000..718e532bc
--- /dev/null
+++ b/docs/src/demos/vben-modal/dynamic/index.vue
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+ Open
+
+ 从外部修改标题并打开
+
+
+
diff --git a/docs/src/demos/vben-modal/dynamic/modal.vue b/docs/src/demos/vben-modal/dynamic/modal.vue
new file mode 100644
index 000000000..d46128965
--- /dev/null
+++ b/docs/src/demos/vben-modal/dynamic/modal.vue
@@ -0,0 +1,38 @@
+
+
+
+
+
+ 内部动态修改标题
+
+
+ {{ state.fullscreen ? '退出全屏' : '打开全屏' }}
+
+
+
+
diff --git a/docs/src/demos/vben-modal/extra/index.vue b/docs/src/demos/vben-modal/extra/index.vue
index 1fa74cd6d..2addf2e90 100644
--- a/docs/src/demos/vben-modal/extra/index.vue
+++ b/docs/src/demos/vben-modal/extra/index.vue
@@ -4,7 +4,7 @@ import { useVbenModal, VbenButton } from '@vben/common-ui';
import ExtraModal from './modal.vue';
const [Modal, modalApi] = useVbenModal({
- // 链接抽离的组件
+ // 连接抽离的组件
connectedComponent: ExtraModal,
});
@@ -16,7 +16,6 @@ function openModal() {
-
- 打开弹窗
+ Open
diff --git a/docs/src/demos/vben-modal/extra/modal.vue b/docs/src/demos/vben-modal/extra/modal.vue
index 68ceb5ee0..488fd4a0d 100644
--- a/docs/src/demos/vben-modal/extra/modal.vue
+++ b/docs/src/demos/vben-modal/extra/modal.vue
@@ -4,5 +4,5 @@ import { useVbenModal } from '@vben/common-ui';
const [Modal] = useVbenModal();
- extra modal content
+ extra modal content
diff --git a/docs/src/demos/vben-modal/shared-data/index.vue b/docs/src/demos/vben-modal/shared-data/index.vue
new file mode 100644
index 000000000..58c35e24d
--- /dev/null
+++ b/docs/src/demos/vben-modal/shared-data/index.vue
@@ -0,0 +1,26 @@
+
+
+
+
+
+
+ Open
+
+
diff --git a/docs/src/demos/vben-modal/shared-data/modal.vue b/docs/src/demos/vben-modal/shared-data/modal.vue
new file mode 100644
index 000000000..806585d99
--- /dev/null
+++ b/docs/src/demos/vben-modal/shared-data/modal.vue
@@ -0,0 +1,26 @@
+
+
+
+ 外部传递数据: {{ data }}
+
+
diff --git a/docs/src/guide/introduction/quick-start.md b/docs/src/guide/introduction/quick-start.md
index 852414f6a..44efcd460 100644
--- a/docs/src/guide/introduction/quick-start.md
+++ b/docs/src/guide/introduction/quick-start.md
@@ -72,6 +72,8 @@ pnpm install
### 运行项目
+#### 选择项目
+
执行以下命运行项目:
```bash
@@ -84,12 +86,24 @@ pnpm dev
```bash
│
◆ Select the app you need to run [dev]:
-│ ● @vben/web-antd
+│ ○ @vben/web-antd
│ ○ @vben/web-ele
│ ○ @vben/web-naive
│ ○ @vben/docs
-│ ○ @vben/playground
+│ ● @vben/playground
└
```
现在,你可以在浏览器访问 `http://localhost:5555` 查看项目。
+
+#### 运行指定项目
+
+如果你不想选择项目,可以直接运行以下命令运行你需要的应用:
+
+```bash
+pnpm run dev:antd
+pnpm run dev:ele
+pnpm run dev:naive
+pnpm run dev:docs
+pnpm run dev:play
+```
diff --git a/docs/src/guide/introduction/vben.md b/docs/src/guide/introduction/vben.md
index d6ffd65c1..90dae0523 100644
--- a/docs/src/guide/introduction/vben.md
+++ b/docs/src/guide/introduction/vben.md
@@ -2,27 +2,27 @@
::: info 你正在阅读的是 [Vben Admin](https://github.com/vbenjs/vue-vben-admin) `5.0`版本的文档!
-- Vben Admin 2.x 目前已经存档,只修复一些严重的问题。
+- Vben Admin 2.x 目前已存档,仅进行重大问题修复。
- 新版本与旧版本不兼容,如果你使用的是旧版本(v2、v3),请查看 [Vue Vben Admin 2.x 文档](https://doc.vvbin.cn)
-- 如发现文档有误,欢迎提提交 Issue 帮助我们改进。
-- 如果你只是想体验一下,你可以查看 [快速开始](./quick-start.md)。
+- 如发现文档有误,欢迎提交 [issue](https://github.com/vbenjs/vue-vben-admin/issues) 帮助我们改进。
+- 如果你只是想体验一下,你可以查看[快速开始](./quick-start.md)。
:::
-[Vben Admin](https://github.com/vbenjs/vue-vben-admin) 是一个基于 [Vue3.0](https://github.com/vuejs/core)、[Vite](https://github.com/vitejs/vite)、 [TypeScript](https://www.typescriptlang.org/) 的后台解决方案,目标是为开发中大型项目提供开箱即用的解决方案。包括二次封装组件、utils、hooks、动态菜单、权限校验、多主题配置、按钮级别权限控制等功能。项目会使用前端较新的技术栈,可以作为项目的启动模版,以帮助你快速搭建企业级中后台产品原型。也可以作为一个示例,用于学习 `vue3`、`vite`、`ts` 等主流技术。该项目会持续跟进最新技术,并将其应用在项目中。
+[Vben Admin](https://github.com/vbenjs/vue-vben-admin) 是一个基于 [Vue3.0](https://github.com/vuejs/core)、[Vite](https://github.com/vitejs/vite)、 [TypeScript](https://www.typescriptlang.org/) 的中后台解决方案,目标是为开发中大型项目提供开箱即用的解决方案。包括二次封装组件、utils、hooks、动态菜单、权限校验、多主题配置、按钮级别权限控制等功能。项目会使用前端较新的技术栈,可以作为项目的启动模板,以帮助你快速搭建企业级中后台产品原型。也可以作为一个示例,用于学习 `vue3`、`vite`、`ts` 等主流技术。该项目会持续跟进最新技术,并将其应用在项目中。
## 特点
- **最新技术栈**:使用 `Vue3`、`Vite`、`TypeScript` 等前端前沿技术开发。
- **国际化**:内置完善的国际化方案,支持多语言切换。
- **权限验证**:完善的权限验证方案,按钮级别权限控制。
-- **多主题**:内置多种主题配置&黑暗模式,满足个性化需求。
+- **多主题**:内置多种主题配置和黑暗模式,满足个性化需求。
- **动态菜单**:支持动态菜单,可以根据权限配置显示菜单。
- **Mock 数据**:基于 Nitro 的本地高性能 Mock 数据方案。
- **组件丰富**:提供了丰富的组件,可以满足大部分的业务需求。
- **规范**:代码规范,使用 `ESLint`、`Prettier`、`Stylelint`、`Publint`、`CSpell` 等工具保证代码质量。
- **工程化**:使用 `Pnpm Monorepo`、`TurboRepo`、`Changeset` 等工具,提高开发效率。
-- **多UI库支持**:支持 `Ant Design Vue`、`Element Plus`、`Vuetify` 等主流 UI 库,不再限制于特定框架。
+- **多UI库支持**:支持 `Ant Design Vue`、`Element Plus`、`Naive` 等主流 UI 库,不再限制于特定框架。
## 浏览器支持
@@ -32,17 +32,15 @@
| [](http://godban.github.io/browsers-support-badges/)IE | [](http://godban.github.io/browsers-support-badges/)Edge | [](http://godban.github.io/browsers-support-badges/)Firefox | [](http://godban.github.io/browsers-support-badges/)Chrome | [](http://godban.github.io/browsers-support-badges/)Safari |
| :-: | :-: | :-: | :-: | :-: |
-| not support | last 2 versions | last 2 versions | last 2 versions | last 2 versions |
+| 不支持 | last 2 versions | last 2 versions | last 2 versions | last 2 versions |
## 贡献
- [Vben Admin](https://github.com/vbenjs/vue-vben-admin) 还在持续更新中,本项目欢迎您的参与,共同维护,逐步完善,打造更好的中后台解决方案。
-- 如果你想加入我们,可以多提供一些好的建议或者提交 pr,我们会根据你的活跃度邀请你加入。
+- 如果你想加入我们,可以提供有价值的建议或者参与讨论,协助解决 issue,- 如果你想加入我们,可以提供有价值的建议或者参与讨论,协助解决 issue,我们会根据你的活跃度邀请你加入。。
::: info 加入我们
-如果你想加入我们,你可以从以下几个方面开始,我们会根据你的活跃度邀请你加入:
-
- 长期提交 `PR`。
- 提供一些好的建议。
- 参与讨论,帮助解决一些 `issue`。
diff --git a/docs/src/guide/introduction/why.md b/docs/src/guide/introduction/why.md
index 28f4cb84d..4191b3ef6 100644
--- a/docs/src/guide/introduction/why.md
+++ b/docs/src/guide/introduction/why.md
@@ -1,9 +1,23 @@
# 为什么选择我们?
-首先,我们不会去和其他框架做比较。我们认为每个框架都有自己的特点,适合不同的场景。我们的目标是提供一个简单、易用的框架,让开发者可以快速上手,专注于业务逻辑的开发。所以我们只会不断完善和优化我们的框架,提供更好的体验。
+::: info 写在前面
+
+我们不会去和其他框架做比较。我们认为每个框架都有自己的特点,适合不同的场景。我们的目标是提供一个简单、易用的框架,让开发者可以快速上手,专注于业务逻辑的开发。所以我们只会不断完善和优化我们的框架,提供更好的体验。
+
+:::
+
+我们致力于为开发者提供一个高效、现代、易用的前端框架。我们的解决方案基于最新的技术栈,如 Vue3、Vite 和 TypeScript,确保您在构建项目时始终走在技术的前沿。同时,我们注重代码的质量与规范,通过严格的工具链保证代码的一致性和可维护性。无论是初创项目还是企业级应用,我们的框架都能帮助您快速构建、迭代和部署。
## 框架历程
从 Vue Vben Admin 1.x 版本开始,框架经历了许多迭代和优化。从一开始使用 `Vite 0.x` 版本,没有现成的插件,开发了很多自定义插件来弥合 Webpack 和 Vite 之间的差异。虽然很多现在已经被代替,但是我们的初衷一直没有变,就是提供一个简单、易用的框架。
虽然中间有段时间由社区维护,但我们一直密切关注 Vue Vben Admin 的发展。见证了许多开发者使用 Vben Admin,并提供了许多宝贵的建议和反馈。非常感谢大家的支持和贡献,这些都是我们持续改进 Vben Admin 的动力。新版本中,我们持续收集用户反馈,重新开始,不断优化框架,以提供更好的用户体验。我们的目标是让开发者能够快速上手,专注于业务逻辑的开发。
+
+## 单元测试
+
+单元测试是确保代码质量的基石。在开发过程中编写和执行单元测试,以捕捉潜在的错误并提升代码的可靠性。框架核心逻辑使用 `vitest` 做了单元测试,并在逐步增加覆盖率。通过单元测试,可以放心地进行代码重构,减少回归问题,从而提高整体开发效率。
+
+## 质量与规范
+
+我们始终高度重视代码的质量与规范。通过使用 ESLint、Prettier、Stylelint、Publint、CSpell 等工具来确保代码质量。我们的代码规范基于 Vue3、Vite、TypeScript 等现代前端技术制定,旨在提供一个简洁、易用的框架,使开发者能够快速上手并专注于业务逻辑的开发。
diff --git a/internal/lint-configs/eslint-config/src/configs/vue.ts b/internal/lint-configs/eslint-config/src/configs/vue.ts
index 41bb8baaa..8c45e8ad0 100644
--- a/internal/lint-configs/eslint-config/src/configs/vue.ts
+++ b/internal/lint-configs/eslint-config/src/configs/vue.ts
@@ -15,10 +15,6 @@ export async function vue(): Promise {
{
files: ['**/*.vue'],
languageOptions: {
- globals: {
- // TODO: 等待插件正式支持后删除
- defineModel: true,
- },
parser: parserVue,
parserOptions: {
ecmaFeatures: {
diff --git a/packages/@core/base/design/src/design-tokens/default/index.css b/packages/@core/base/design/src/design-tokens/default/index.css
index 5394902c2..d9652e422 100644
--- a/packages/@core/base/design/src/design-tokens/default/index.css
+++ b/packages/@core/base/design/src/design-tokens/default/index.css
@@ -77,7 +77,7 @@
/* ============= custom ============= */
/* 遮罩颜色 */
- --overlay: 0deg 0% 0% / 30%;
+ --overlay: 0 0% 0% / 30%;
/* 基本文字大小 */
--font-size-base: 16px;
diff --git a/packages/@core/ui-kit/popup-ui/src/drawer/drawer-api.ts b/packages/@core/ui-kit/popup-ui/src/drawer/drawer-api.ts
index b969bdee9..9bfb00f5d 100644
--- a/packages/@core/ui-kit/popup-ui/src/drawer/drawer-api.ts
+++ b/packages/@core/ui-kit/popup-ui/src/drawer/drawer-api.ts
@@ -38,7 +38,6 @@ export class DrawerApi {
isOpen: false,
loading: false,
modal: true,
- sharedData: {},
title: '',
};
@@ -93,7 +92,11 @@ export class DrawerApi {
* 取消操作
*/
onCancel() {
- this.api.onCancel?.();
+ if (this.api.onCancel) {
+ this.api.onCancel?.();
+ } else {
+ this.close();
+ }
}
/**
diff --git a/packages/@core/ui-kit/popup-ui/src/drawer/drawer.vue b/packages/@core/ui-kit/popup-ui/src/drawer/drawer.vue
index 5d8a904d9..1a5624267 100644
--- a/packages/@core/ui-kit/popup-ui/src/drawer/drawer.vue
+++ b/packages/@core/ui-kit/popup-ui/src/drawer/drawer.vue
@@ -1,6 +1,8 @@
+
+
+
+
diff --git a/playground/src/views/examples/drawer/auto-height-demo.vue b/playground/src/views/examples/drawer/auto-height-demo.vue
index d3f14309a..0c327340c 100644
--- a/playground/src/views/examples/drawer/auto-height-demo.vue
+++ b/playground/src/views/examples/drawer/auto-height-demo.vue
@@ -5,6 +5,8 @@ import { useVbenDrawer } from '@vben/common-ui';
import { Button, message } from 'ant-design-vue';
+const list = ref([]);
+
const [Drawer, drawerApi] = useVbenDrawer({
onCancel() {
drawerApi.close();
@@ -13,14 +15,19 @@ const [Drawer, drawerApi] = useVbenDrawer({
message.info('onConfirm');
// drawerApi.close();
},
+ onOpenChange(isOpen) {
+ if (isOpen) {
+ handleUpdate(10);
+ }
+ },
});
-const list = ref([]);
-
-list.value = Array.from({ length: 10 }, (_v, k) => k + 1);
-
-function handleUpdate() {
- list.value = Array.from({ length: 6 }, (_v, k) => k + 1);
+function handleUpdate(len: number) {
+ drawerApi.setState({ loading: true });
+ setTimeout(() => {
+ list.value = Array.from({ length: len }, (_v, k) => k + 1);
+ drawerApi.setState({ loading: false });
+ }, 2000);
}
@@ -34,7 +41,7 @@ function handleUpdate() {
-
+
diff --git a/playground/src/views/examples/drawer/base-demo.vue b/playground/src/views/examples/drawer/base-demo.vue
index b01ee8d68..ffa5e3900 100644
--- a/playground/src/views/examples/drawer/base-demo.vue
+++ b/playground/src/views/examples/drawer/base-demo.vue
@@ -11,14 +11,6 @@ const [Drawer, drawerApi] = useVbenDrawer({
message.info('onConfirm');
// drawerApi.close();
},
- onOpenChange(isOpen) {
- if (isOpen) {
- drawerApi.setState({ loading: true });
- setTimeout(() => {
- drawerApi.setState({ loading: false });
- }, 2000);
- }
- },
});
diff --git a/playground/src/views/examples/drawer/index.vue b/playground/src/views/examples/drawer/index.vue
index d86c8d1f7..30ff0e489 100644
--- a/playground/src/views/examples/drawer/index.vue
+++ b/playground/src/views/examples/drawer/index.vue
@@ -3,18 +3,18 @@ import { Page, useVbenDrawer } from '@vben/common-ui';
import { Button, Card } from 'ant-design-vue';
+import DocButton from '../doc-button.vue';
import AutoHeightDemo from './auto-height-demo.vue';
import BaseDemo from './base-demo.vue';
import DynamicDemo from './dynamic-demo.vue';
import SharedDataDemo from './shared-data-demo.vue';
const [BaseDrawer, baseDrawerApi] = useVbenDrawer({
- // 链接抽离的组件
+ // 连接抽离的组件
connectedComponent: BaseDemo,
});
const [AutoHeightDrawer, autoHeightDrawerApi] = useVbenDrawer({
- // 链接抽离的组件
connectedComponent: AutoHeightDemo,
});
@@ -57,6 +57,9 @@ function openSharedDrawer() {
description="抽屉组件通常用于在当前页面上显示一个覆盖层,用以展示重要信息或提供用户交互界面。"
title="抽屉组件示例"
>
+
+
+
diff --git a/playground/src/views/examples/modal/auto-height-demo.vue b/playground/src/views/examples/modal/auto-height-demo.vue
index 04f8bb3ae..172289ce9 100644
--- a/playground/src/views/examples/modal/auto-height-demo.vue
+++ b/playground/src/views/examples/modal/auto-height-demo.vue
@@ -5,24 +5,31 @@ import { useVbenModal } from '@vben/common-ui';
import { Button, message } from 'ant-design-vue';
+const list = ref([]);
+
const [Modal, modalApi] = useVbenModal({
onCancel() {
modalApi.close();
},
onConfirm() {
message.info('onConfirm');
- // modalApi.close();
+ },
+ onOpenChange(isOpen) {
+ if (isOpen) {
+ handleUpdate(10);
+ }
},
});
-const list = ref([]);
-
-list.value = Array.from({ length: 10 }, (_v, k) => k + 1);
-
-function handleUpdate() {
- list.value = Array.from({ length: 6 }, (_v, k) => k + 1);
+function handleUpdate(len: number) {
+ modalApi.setState({ loading: true });
+ setTimeout(() => {
+ list.value = Array.from({ length: len }, (_v, k) => k + 1);
+ modalApi.setState({ loading: false });
+ }, 2000);
}
+
{{ item }}
-
-
+
diff --git a/playground/src/views/examples/modal/base-demo.vue b/playground/src/views/examples/modal/base-demo.vue
index c4161f30c..82ff389e0 100644
--- a/playground/src/views/examples/modal/base-demo.vue
+++ b/playground/src/views/examples/modal/base-demo.vue
@@ -11,14 +11,6 @@ const [Modal, modalApi] = useVbenModal({
message.info('onConfirm');
// modalApi.close();
},
- onOpenChange(isOpen) {
- if (isOpen) {
- modalApi.setState({ loading: true });
- setTimeout(() => {
- modalApi.setState({ loading: false });
- }, 2000);
- }
- },
});
diff --git a/playground/src/views/examples/modal/index.vue b/playground/src/views/examples/modal/index.vue
index 1ce800ffe..14a939b40 100644
--- a/playground/src/views/examples/modal/index.vue
+++ b/playground/src/views/examples/modal/index.vue
@@ -3,6 +3,7 @@ import { Page, useVbenModal } from '@vben/common-ui';
import { Button, Card } from 'ant-design-vue';
+import DocButton from '../doc-button.vue';
import AutoHeightDemo from './auto-height-demo.vue';
import BaseDemo from './base-demo.vue';
import DragDemo from './drag-demo.vue';
@@ -10,7 +11,7 @@ import DynamicDemo from './dynamic-demo.vue';
import SharedDataDemo from './shared-data-demo.vue';
const [BaseModal, baseModalApi] = useVbenModal({
- // 链接抽离的组件
+ // 连接抽离的组件
connectedComponent: BaseDemo,
});
@@ -62,9 +63,12 @@ function handleUpdateTitle() {
+
+
+