diff --git a/CHANGELOG.md b/CHANGELOG.md
index 4e006ed6..dd736f8a 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -11,7 +11,6 @@
- 更新 `vue` 版本至 `3.4.7`
- 更新 `naive-ui` 版本至 `2.37.3`
- 更新最新版本 `vue` 后,更新 `createDiscreteApi` 方法注册上下文,改为函数包裹,避免 `slot default invoked outside of render` 警告
-- 使用 [`NFlex`](https://www.naiveui.com/zh-CN/dark/components/flex) 组件替换 `NSpace` 组件,根据官方建议,尽量使用该组件
- `menu store` 相关
- 优化 `setupAppMenu` 方法,初始化时会拼接完整的 `fullPath`,避免 `url`, `menu value` 更新路由时重复处理 `path`,提高性能
- 优化 `updateMenuKeyWhenRouteUpdate` 方法,减少 `path` 处理操作
diff --git a/src/app-components/app/AppAvatar/index.tsx b/src/app-components/app/AppAvatar/index.tsx
index b977b47f..73696d0c 100644
--- a/src/app-components/app/AppAvatar/index.tsx
+++ b/src/app-components/app/AppAvatar/index.tsx
@@ -19,9 +19,9 @@
import './index.scss'
-import { NAvatar, NFlex } from 'naive-ui'
+import { NAvatar, NSpace } from 'naive-ui'
-import { avatarProps, flexProps } from 'naive-ui'
+import { avatarProps, spaceProps } from 'naive-ui'
import { APP_CATCH_KEY } from '@/app-config'
import { getStorage } from '@/utils'
@@ -33,7 +33,7 @@ const AppAvatar = defineComponent({
name: 'AppAvatar',
props: {
...avatarProps,
- ...flexProps,
+ ...spaceProps,
cursor: {
type: String,
default: 'auto',
@@ -64,11 +64,12 @@ const AppAvatar = defineComponent({
},
render() {
return (
-
{this.signing?.name}
-
+
)
},
})
diff --git a/src/app-components/app/AppLockScreen/components/UnlockScreen/index.tsx b/src/app-components/app/AppLockScreen/components/UnlockScreen/index.tsx
index 67a739ab..d2c31e2d 100644
--- a/src/app-components/app/AppLockScreen/components/UnlockScreen/index.tsx
+++ b/src/app-components/app/AppLockScreen/components/UnlockScreen/index.tsx
@@ -11,7 +11,7 @@
/** 解锁界面 */
-import { NInput, NForm, NFormItem, NButton, NFlex } from 'naive-ui'
+import { NInput, NForm, NFormItem, NButton, NSpace } from 'naive-ui'
import AppAvatar from '@/app-components/app/AppAvatar'
import dayjs from 'dayjs'
@@ -137,14 +137,14 @@ export default defineComponent({
}}
/>
-
+
返回登陆
进入系统
-
+
diff --git a/src/app-components/app/RayLink/index.tsx b/src/app-components/app/RayLink/index.tsx
index 908e38ec..5ca52f8c 100644
--- a/src/app-components/app/RayLink/index.tsx
+++ b/src/app-components/app/RayLink/index.tsx
@@ -3,7 +3,7 @@
* 友情链接组件,无实际项目意义
*/
-import { NAvatar, NTooltip, NFlex } from 'naive-ui'
+import { NAvatar, NTooltip, NSpace } from 'naive-ui'
interface AvatarOptions {
key: string
@@ -65,7 +65,7 @@ export default defineComponent({
},
render() {
return (
-
+
{this.avatarOptions.map((curr) => (
{{
@@ -85,7 +85,7 @@ export default defineComponent({
}}
))}
-
+
)
},
})
diff --git a/src/components/RCollapseGrid/src/index.tsx b/src/components/RCollapseGrid/src/index.tsx
index 6b3f4244..9c4babe1 100644
--- a/src/components/RCollapseGrid/src/index.tsx
+++ b/src/components/RCollapseGrid/src/index.tsx
@@ -21,7 +21,7 @@
import './index.scss'
-import { NCard, NGrid, NGridItem, NFlex } from 'naive-ui'
+import { NCard, NGrid, NGridItem, NSpace } from 'naive-ui'
import { RIcon } from '@/components'
import { call } from '@/utils'
@@ -85,10 +85,10 @@ export default defineComponent({
>
{this.$slots.default?.()}
-
+
{this.$slots.action?.()}
{this.CollapseIcon()}
-
+
),
diff --git a/src/components/RTable/src/Table.tsx b/src/components/RTable/src/Table.tsx
index 6f947985..aaad7d3c 100644
--- a/src/components/RTable/src/Table.tsx
+++ b/src/components/RTable/src/Table.tsx
@@ -11,7 +11,7 @@
import './index.scss'
-import { NCard, NDataTable, NDropdown, NFlex } from 'naive-ui'
+import { NCard, NDataTable, NDropdown, NSpace } from 'naive-ui'
import Size from './components/Size'
import Fullscreen from './components/Fullscreen'
import C from './components/C'
@@ -238,10 +238,10 @@ export default defineComponent({
defaultElement:
,
}),
'header-extra': () => (
-
+
{/* eslint-disable @typescript-eslint/no-explicit-any */}
{tool(this.$props as any)}
-
+
),
footer: () => this.$slots.tableFooter?.(),
action: () => this.$slots.tableAction?.(),
diff --git a/src/components/RTable/src/components/C.tsx b/src/components/RTable/src/components/C.tsx
index a2962afe..636fabea 100644
--- a/src/components/RTable/src/components/C.tsx
+++ b/src/components/RTable/src/components/C.tsx
@@ -18,7 +18,7 @@
* 2. 大量数据的时候,可能会出现性能问题
*/
-import { NPopover, NFlex, NTree } from 'naive-ui'
+import { NPopover, NSpace, NTree } from 'naive-ui'
import { RIcon } from '@/components'
import config from '../config'
@@ -129,7 +129,7 @@ export default defineComponent({
return {
...attr,
suffix: () => (
-
+
-
+
),
}
}) as C[]
diff --git a/src/directives/README_DIR.md b/src/directives/README_DIR.md
index 8e76c48e..382f1a0b 100644
--- a/src/directives/README_DIR.md
+++ b/src/directives/README_DIR.md
@@ -8,7 +8,7 @@
#### 示例
```tsx
-import { NFlex, NCard, NInput, NInputGroup, NButton, NSwitch } from 'naive-ui'
+import { NSpace, NCard, NInput, NInputGroup, NButton, NSwitch } from 'naive-ui'
const Demo = defineComponent({
name: 'Demo',
@@ -46,7 +46,7 @@ const Demo = defineComponent({
#### 示例
```tsx
-import { NFlex, NCard, NInput, NInputGroup, NButton, NSwitch } from 'naive-ui'
+import { NSpace, NCard, NInput, NInputGroup, NButton, NSwitch } from 'naive-ui'
const Demo = defineComponent({
name: 'Demo',
@@ -64,7 +64,7 @@ const Demo = defineComponent({
},
render() {
return (
-
+
我执行了{this.demoValue}次
该方法将延迟 1s 执行
-
+
)
},
})
@@ -99,7 +99,7 @@ const Demo = defineComponent({
#### 示例
```tsx
-import { NFlex, NCard, NInput, NInputGroup, NButton, NSwitch } from 'naive-ui'
+import { NSpace, NCard, NInput, NInputGroup, NButton, NSwitch } from 'naive-ui'
const Demo = defineComponent({
name: 'Demo',
@@ -117,7 +117,7 @@ const Demo = defineComponent({
},
render() {
return (
-
+
我执行了{this.demoValue}次
该方法 1s 内仅会执行一次
-
+
)
},
})
@@ -149,7 +149,7 @@ const Demo = defineComponent({
```tsx
import {
- NFlex,
+ NSpace,
NCard,
NInput,
NInputGroup,
@@ -170,7 +170,7 @@ const Demo = defineComponent({
},
render() {
return (
-
+
{{
checked: () => '取消',
@@ -182,22 +182,22 @@ const Demo = defineComponent({
组件提供了完整的 disabled
属性,所以在组件库有禁用需求时,直接调用组件库 disabled 属性即可
-
+
-
+
-
+
-
+
我是可以被禁用的文本内容
-
+
-
+
按钮
@@ -205,10 +205,10 @@ const Demo = defineComponent({
-
+
-
-
+
+
)
},
})
diff --git a/src/layout/components/MenuTag/index.tsx b/src/layout/components/MenuTag/index.tsx
index 65165439..b239480a 100644
--- a/src/layout/components/MenuTag/index.tsx
+++ b/src/layout/components/MenuTag/index.tsx
@@ -33,7 +33,7 @@ import './index.scss'
import {
NScrollbar,
- NFlex,
+ NSpace,
NLayoutHeader,
NDropdown,
NButton,
@@ -456,12 +456,13 @@ export default defineComponent({
this.actionState.actionDropdownShow = false
}}
/>
-
-
+
+
)
diff --git a/src/layout/components/SiderBar/components/GlobalSearch/index.tsx b/src/layout/components/SiderBar/components/GlobalSearch/index.tsx
index 4e4ac4c3..7dfc5c8f 100644
--- a/src/layout/components/SiderBar/components/GlobalSearch/index.tsx
+++ b/src/layout/components/SiderBar/components/GlobalSearch/index.tsx
@@ -20,7 +20,7 @@
import './index.scss'
-import { NInput, NModal, NResult, NScrollbar, NFlex } from 'naive-ui'
+import { NInput, NModal, NResult, NScrollbar, NSpace } from 'naive-ui'
import { RIcon } from '@/components'
import { queryElements, addClass, removeClass } from '@/utils'
@@ -255,7 +255,7 @@ export default defineComponent({
}
const SearchItem = ({ menuOption }: { menuOption: AppMenuOption }) => (
-