From 5c5d49a58cc22c535e50204704e3c00dbc94cfad Mon Sep 17 00:00:00 2001 From: kylin <260987762@qq.com> Date: Mon, 30 Sep 2024 18:09:33 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=BB=84=E4=BB=B6=EF=BC=8C?= =?UTF-8?q?=E5=B9=B6=E4=B8=94=E6=B7=BB=E5=8A=A0=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README-zh_CN.md | 8 +- README.md | 32 +++-- docs/.vitepress/locales/cn.ts | 16 +++ docs/cn/other/breadcrumb.md | 36 +++++ docs/cn/other/checkCard.md | 29 ++++ docs/cn/other/checkbox.md | 25 ++++ docs/cn/other/columnSetting.md | 2 +- .../cn/other/components/DemoProBreadcrumb.vue | 35 +++++ .../other/components/DemoProBreadcrumb2.vue | 50 +++++++ .../other/components/DemoProBreadcrumb3.vue | 38 +++++ docs/cn/other/components/DemoProCheckCard.vue | 23 +++ .../cn/other/components/DemoProCheckCard2.vue | 23 +++ .../cn/other/components/DemoProCheckCard3.vue | 31 ++++ docs/cn/other/components/DemoProCheckbox.vue | 25 ++++ docs/cn/other/components/DemoProCheckbox2.vue | 30 ++++ docs/cn/other/components/DemoProRadio.vue | 20 +++ docs/cn/other/components/DemoProRadio2.vue | 20 +++ docs/cn/other/radio.md | 25 ++++ package.json | 2 +- packages/k-naiveui-pro/.idea/.gitignore | 5 + packages/k-naiveui-pro/package.json | 4 +- .../src/components/ProBreadcrumb.vue | 65 +++++++++ .../src/components/ProCheckCard.vue | 136 ++++++++++++++++++ .../src/components/ProCheckbox.vue | 43 ++++++ .../src/components/ProDescriptions.vue | 2 +- .../k-naiveui-pro/src/components/ProRadio.vue | 43 ++++++ .../k-naiveui-pro/src/components/index.ts | 6 +- 27 files changed, 751 insertions(+), 23 deletions(-) create mode 100644 docs/cn/other/breadcrumb.md create mode 100644 docs/cn/other/checkCard.md create mode 100644 docs/cn/other/checkbox.md create mode 100644 docs/cn/other/components/DemoProBreadcrumb.vue create mode 100644 docs/cn/other/components/DemoProBreadcrumb2.vue create mode 100644 docs/cn/other/components/DemoProBreadcrumb3.vue create mode 100644 docs/cn/other/components/DemoProCheckCard.vue create mode 100644 docs/cn/other/components/DemoProCheckCard2.vue create mode 100644 docs/cn/other/components/DemoProCheckCard3.vue create mode 100644 docs/cn/other/components/DemoProCheckbox.vue create mode 100644 docs/cn/other/components/DemoProCheckbox2.vue create mode 100644 docs/cn/other/components/DemoProRadio.vue create mode 100644 docs/cn/other/components/DemoProRadio2.vue create mode 100644 docs/cn/other/radio.md create mode 100644 packages/k-naiveui-pro/.idea/.gitignore create mode 100644 packages/k-naiveui-pro/src/components/ProBreadcrumb.vue create mode 100644 packages/k-naiveui-pro/src/components/ProCheckCard.vue create mode 100644 packages/k-naiveui-pro/src/components/ProCheckbox.vue create mode 100644 packages/k-naiveui-pro/src/components/ProRadio.vue diff --git a/README-zh_CN.md b/README-zh_CN.md index 3443f43..e385129 100644 --- a/README-zh_CN.md +++ b/README-zh_CN.md @@ -106,16 +106,18 @@ export default defineConfig({ - [X] 添加 ProQueryForm - [X] 添加 ProStepsForm - [ ] 添加 ProCrud -- [ ] 添加 ProBreadcrumb +- [X] 添加 ProBreadcrumb - [X] 添加 ProBackground - [X] 添加 ProTabs -- [ ] 添加 ProCheckbox -- [ ] 添加 ProRadio +- [X] 添加 ProCheckbox +- [X] 添加 ProRadio - [X] 添加 ProColumnSetting - [X] 添加 ProDescriptions - [X] 添加 ProToggleFullScreen - [X] 添加 ProToggleLanguage - [X] 添加 ProToggleTheme +- [X] 添加 ProCheckCard +- [X] 添加 ProAvatar ## License diff --git a/README.md b/README.md index 274e6cb..006eb70 100644 --- a/README.md +++ b/README.md @@ -102,21 +102,23 @@ export default defineConfig({ ## List of things to do -- [X] Add a ProLayout -- [X] Add a ProBaseForm -- [X] Add a ProQueryForm -- [X] Add a ProStepsForm -- [ ] Add a ProCrud -- [ ] Add a ProBreadcrumb -- [X] Add a ProBackground -- [X] Add a ProTabs -- [ ] Add a ProCheckbox -- [ ] Add a ProRadio -- [X] Add a ProColumnSetting -- [X] Add a ProDescriptions -- [X] Add a ProToggleFullScreen -- [X] Add a ProToggleLanguage -- [X] Add a ProToggleTheme +- [X] Add a ProLayout +- [X] Add a ProBaseForm +- [X] Add a ProQueryForm +- [X] Add a ProStepsForm +- [ ] Add a ProCrud +- [X] Add a ProBreadcrumb +- [X] Add a ProBackground +- [X] Add a ProTabs +- [X] Add a ProCheckbox +- [X] Add a ProRadio +- [X] Add a ProColumnSetting +- [X] Add a ProDescriptions +- [X] Add a ProToggleFullScreen +- [X] Add a ProToggleLanguage +- [X] Add a ProToggleTheme +- [X] Add a ProCheckCard +- [X] Add a ProAvatar ## License MIT diff --git a/docs/.vitepress/locales/cn.ts b/docs/.vitepress/locales/cn.ts index 6033890..eda8f84 100755 --- a/docs/.vitepress/locales/cn.ts +++ b/docs/.vitepress/locales/cn.ts @@ -89,6 +89,22 @@ export const cnConfig: LocaleSpecificConfig = { text: 'ProDescriptions', link: '/cn/other/descriptions.md' }, + { + text: 'ProCheckbox', + link: '/cn/other/checkbox.md' + }, + { + text: 'ProRadio', + link: '/cn/other/radio.md' + }, + { + text: 'ProCheckCard', + link: '/cn/other/checkCard.md' + }, + { + text: 'ProBreadcrumb', + link: '/cn/other/breadcrumb.md' + }, ] }, ], diff --git a/docs/cn/other/breadcrumb.md b/docs/cn/other/breadcrumb.md new file mode 100644 index 0000000..a18f760 --- /dev/null +++ b/docs/cn/other/breadcrumb.md @@ -0,0 +1,36 @@ +# ProBreadcrumb + +> `ProBreadcrumb` 是基于 `Naive UI` 的 `n-breadcrumb` 组件封装的面包屑导航组件。它提供了更加灵活的配置方式,支持自定义样式和类名,能够满足更多样化的需求。 + + + + + + + + +## Props + +### ProBreadcrumbProps + +| 参数 | 类型 | 默认值 | 说明 | +|-----------------|-------------------------------------------------|-------|---------------------------------| +| customClass | `string \| string[] \| Record` | — | 自定义面包屑容器的类名,支持字符串、字符串数组或对象形式的类名 | +| customLinkClass | `string \| string[] \| Record` | — | 自定义面包屑链接的类名,支持字符串、字符串数组或对象形式的类名 | +| options | `BreadcrumbOption[]` | `[]` | 面包屑导航项的配置数组,包含每个导航项的属性 | +| separator | `string \| (() => JSX.Element)` | `'/'` | 分隔符,可以是字符串或返回 JSX 元素的函数 | + +### ProBreadcrumbOption + +| 参数 | 类型 | 默认值 | 说明 | +|-------|----------|-------------|---------------------------------| +| label | `string` | `''` | 导航项的显示文本 | +| path | `string` | `undefined` | 导航项的路径,点击后会通过事件传递给外部处理 | +| icon | `string` | `undefined` | 面包屑项的图标,传入 `@iconify/vue` 的图标名称 | + + +### 事件 + +| 事件名 | 回调参数 | 说明 | +|------------|------------------|--------------------------------------------------------------------------| +| item-click | `(path: string)` | 当点击带有 path 属性的面包屑项时,会触发 item-click 事件,并将 path 作为参数传递出去,外部组件可以监听该事件并进行处理。 | \ No newline at end of file diff --git a/docs/cn/other/checkCard.md b/docs/cn/other/checkCard.md new file mode 100644 index 0000000..78dba37 --- /dev/null +++ b/docs/cn/other/checkCard.md @@ -0,0 +1,29 @@ +# ProCheckCard + +> `ProCheckCard` 是基于 `Naive UI` 组件库封装的多功能选择卡片组件。它集成了选择(多选或单选)和卡片样式展示的功能,适用于需要以卡片形式展示内容且支持选择的场景,如商品选择、选项卡等。 + + + + + + + +## 参数 + +| 参数 | 类型 | 默认值 | 说明 | +|------------|----------------------------------------------|-------------|------------------------------------| +| value | `ProCheckCardValue` \| `ProCheckCardValue[]` | `undefined` | 选中的值,支持单个值或数组形式(与 `modelValue` 等效) | +| modelValue | `ProCheckCardValue` \| `ProCheckCardValue[]` | `undefined` | 选中的值,支持 `v-model` 双向绑定 | +| options | `Array