diff --git a/configure/publish/publish-newVersion.sh b/configure/publish/publish-newVersion.sh index 52d08df4..37d10c92 100644 --- a/configure/publish/publish-newVersion.sh +++ b/configure/publish/publish-newVersion.sh @@ -21,6 +21,28 @@ job_before_checked() { printf "============================================\n\n" } +job_switch_to_version_branch() { + printf "\n\tJob switch to version branch \n" + printf "============================================\n" + + # 检查分支是否存在 + if git show-ref --verify --quiet "refs/heads/$VERSION"; then + printf "Branch '%s' exists, switching...\n" "$VERSION" + git checkout "$VERSION" + else + printf "Branch '%s' does not exist, creating...\n" "$VERSION" + git checkout -b "$VERSION" + fi + + if [ $? -ne 0 ]; then + printf "Failed to switch to branch '%s'\n" "$VERSION" + exit 1 + fi + + printf "Now on branch: %s\n" "$VERSION" + printf "============================================\n\n" +} + job_check_version_diff() { printf "\n\tJob check version difference \n" printf "============================================\n" @@ -121,6 +143,7 @@ job_runner_apply_playground() { job_before_echo_basic job_before_checked +job_switch_to_version_branch job_check_version_diff job_runner_apply -job_runner_apply_playground +job_runner_apply_playground \ No newline at end of file diff --git a/docs/components/layout/layout.md b/docs/components/layout/layout.md index e9a65f64..2ab47490 100644 --- a/docs/components/layout/layout.md +++ b/docs/components/layout/layout.md @@ -8,13 +8,15 @@ title: 布局 (Layout) 本文档主要用于描述 `ShadcnLayout` 组件的一些特性和用法。 -## 用法 +Layout 组件提供了经典的页面布局,包含 Header、Content、Footer 和 Sider 组件,支持自动识别侧边栏并调整布局方向。 - - - Header - Content - Footer +## 基础用法 + + + + Header + Content + Footer @@ -23,9 +25,9 @@ title: 布局 (Layout) ```vue @@ -35,18 +37,18 @@ title: 布局 (Layout) ::: -## 侧边栏 (sider) - - - - - Sider - - Header - Content - Footer - - +## 带侧边栏的布局 + +Layout 会自动检测子组件中是否包含 Sider,如果包含则使用横向布局,否则使用纵向布局。 + + + + Sider + + Header + Content + Footer + @@ -54,16 +56,14 @@ title: 布局 (Layout) ```vue +``` + +::: + +## 自定义折叠内容 + +通过插槽可以自定义折叠状态下的内容。 + + + + + + + + + Header + Content + Footer + + + +::: details 查看代码 + +```vue + diff --git a/src/ui/layout/ShadcnLayout.vue b/src/ui/layout/ShadcnLayout.vue index be9f8528..bd8bfa31 100644 --- a/src/ui/layout/ShadcnLayout.vue +++ b/src/ui/layout/ShadcnLayout.vue @@ -1,47 +1,26 @@ diff --git a/src/ui/layout/ShadcnLayoutContent.vue b/src/ui/layout/ShadcnLayoutContent.vue index cad26812..09e45d75 100644 --- a/src/ui/layout/ShadcnLayoutContent.vue +++ b/src/ui/layout/ShadcnLayoutContent.vue @@ -1,16 +1,8 @@ diff --git a/src/ui/layout/ShadcnLayoutFooter.vue b/src/ui/layout/ShadcnLayoutFooter.vue index 1cf4dfcf..3e20eb6f 100644 --- a/src/ui/layout/ShadcnLayoutFooter.vue +++ b/src/ui/layout/ShadcnLayoutFooter.vue @@ -1,16 +1,8 @@ diff --git a/src/ui/layout/ShadcnLayoutHeader.vue b/src/ui/layout/ShadcnLayoutHeader.vue index 9ed50037..3af12ab8 100644 --- a/src/ui/layout/ShadcnLayoutHeader.vue +++ b/src/ui/layout/ShadcnLayoutHeader.vue @@ -1,16 +1,8 @@ diff --git a/src/ui/layout/ShadcnLayoutMain.vue b/src/ui/layout/ShadcnLayoutMain.vue deleted file mode 100644 index 14d4fe71..00000000 --- a/src/ui/layout/ShadcnLayoutMain.vue +++ /dev/null @@ -1,15 +0,0 @@ - - - diff --git a/src/ui/layout/ShadcnLayoutSider.vue b/src/ui/layout/ShadcnLayoutSider.vue index c49f32dc..9f057af2 100644 --- a/src/ui/layout/ShadcnLayoutSider.vue +++ b/src/ui/layout/ShadcnLayoutSider.vue @@ -1,38 +1,27 @@ diff --git a/src/ui/layout/index.ts b/src/ui/layout/index.ts index bf4cecae..5b73dab6 100644 --- a/src/ui/layout/index.ts +++ b/src/ui/layout/index.ts @@ -3,5 +3,3 @@ export { default as ShadcnLayoutHeader } from './ShadcnLayoutHeader.vue' export { default as ShadcnLayoutContent } from './ShadcnLayoutContent.vue' export { default as ShadcnLayoutSider } from './ShadcnLayoutSider.vue' export { default as ShadcnLayoutFooter } from './ShadcnLayoutFooter.vue' -export { default as ShadcnLayoutWrapper } from './ShadcnLayoutWrapper.vue' -export { default as ShadcnLayoutMain } from './ShadcnLayoutMain.vue' diff --git a/types/view-shadcn.d.ts b/types/view-shadcn.d.ts index b97aa287..be7f3099 100644 --- a/types/view-shadcn.d.ts +++ b/types/view-shadcn.d.ts @@ -38,8 +38,6 @@ declare module 'view-shadcn-ui' export const ShadcnLayoutContent: typeof import('@/ui/layout/content').default export const ShadcnLayoutSider: typeof import('@/ui/layout/sider').default export const ShadcnLayoutFooter: typeof import('@/ui/layout/footer').default - export const ShadcnLayoutWrapper: typeof import('@/ui/layout/wrapper').default - export const ShadcnLayoutMain: typeof import('@/ui/layout/main').default export const ShadcnPagination: typeof import('@/ui/pagination').default export const ShadcnDrawer: typeof import('@/ui/drawer').default export const ShadcnMenu: typeof import('@/ui/menu').default