diff --git a/CHANGELOG.md b/CHANGELOG.md index e0ad596d..bdddad52 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,3 +12,10 @@ - 新增面包屑 - 支持国际化语言包分包管理(但是,依旧是合并到一个文件中,所以需要注意 key 的管理) - 新增国内预览地址 + +## 3.1.2 + +### Feats + +- 修改 demo 页面展示 +- 修改 RayCollapseGrid, RayTable 组件为默认不展示 border diff --git a/package.json b/package.json index 4845640e..1f849fb1 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "ray-template", "private": true, - "version": "3.1.1", + "version": "3.1.2", "type": "module", "scripts": { "dev": "vite", diff --git a/src/components/RayCollapseGrid/src/props.ts b/src/components/RayCollapseGrid/src/props.ts index 1c156b48..4ae28dac 100644 --- a/src/components/RayCollapseGrid/src/props.ts +++ b/src/components/RayCollapseGrid/src/props.ts @@ -33,10 +33,10 @@ export const collapseGridProps = { * * 卡片边框 * - * 默认 `true` + * 默认 `false` */ type: Boolean, - default: true, + default: false, }, ...gridProps, } as const diff --git a/src/components/RayTable/src/index.tsx b/src/components/RayTable/src/index.tsx index db79ff81..11f3f68b 100644 --- a/src/components/RayTable/src/index.tsx +++ b/src/components/RayTable/src/index.tsx @@ -9,6 +9,23 @@ * @remark 今天也是元气满满撸代码的一天 */ +/** + * + * + * + * 完全继承 `NDataTable`, 该组件继承 `NDataTable Props` 属性和方法 + * + * 实现: 抬头, 操作栏, 右键菜单功能拓展, 输出 `excel` + * + * 右键菜单功能, 需要同时启用 `showMenu` 与配置菜单选项才能正常使用 + * + * 可以通过设置 `action` 为 `false` 隐藏操作栏 + * + * 具体拓展 `props` 方法, 可以查看 `props.ts` 中相关注释与代码 + * + * 基于 `xlsx.js` 实现输出 `excel` + */ + import './index.scss' import { NDataTable, NCard, NDropdown, NDivider } from 'naive-ui' import TableSetting from './components/TableSetting/index' @@ -240,20 +257,3 @@ const RayTable = defineComponent({ }) export default RayTable - -/** - * - * - * - * 完全继承 `NDataTable`, 该组件继承 `NDataTable Props` 属性和方法 - * - * 实现: 抬头, 操作栏, 右键菜单功能拓展, 输出 `excel` - * - * 右键菜单功能, 需要同时启用 `showMenu` 与配置菜单选项才能正常使用 - * - * 可以通过设置 `action` 为 `false` 隐藏操作栏 - * - * 具体拓展 `props` 方法, 可以查看 `props.ts` 中相关注释与代码 - * - * 基于 `xlsx.js` 实现输出 `excel` - */ diff --git a/src/components/RayTable/src/props.ts b/src/components/RayTable/src/props.ts index bf66df04..7de02339 100644 --- a/src/components/RayTable/src/props.ts +++ b/src/components/RayTable/src/props.ts @@ -205,7 +205,7 @@ const rayTableProps = { * 表格边框 */ type: Boolean, - default: true, + default: false, }, } as const diff --git a/src/views/dashboard/index.tsx b/src/views/dashboard/index.tsx index 68d4337c..b1754657 100644 --- a/src/views/dashboard/index.tsx +++ b/src/views/dashboard/index.tsx @@ -6,6 +6,8 @@ import { NDescriptionsItem, NTag, NSpace, + NP, + NH6, } from 'naive-ui' import RayIcon from '@/components/RayIcon/index' import RayLink from '@/components/RayLink/index' @@ -58,9 +60,28 @@ const Dashboard = defineComponent({ span: 2, }, ] + const technologyTagOptions = [ + { + label: 'Vue3.x', + value: 'Vue3.x', + }, + { + label: 'Vite4.0', + value: 'Vite4.0', + }, + { + label: 'Pinia', + value: 'Pinia', + }, + { + label: 'TSX', + value: 'TSX', + }, + ] return { coverLetterOptions, + technologyTagOptions, } }, render() { @@ -93,6 +114,22 @@ const Dashboard = defineComponent({ ))} + + 技术栈 + + + {this.technologyTagOptions.map((curr) => ( + + {curr.label} + + ))} + + + 项目介绍 + + 预设了最佳构建体验的配置与常用搬砖工具。意在提供一个简洁、快速上手的模板。 + + diff --git a/src/views/echart/index.tsx b/src/views/echart/index.tsx index 0eb53de3..9d519596 100644 --- a/src/views/echart/index.tsx +++ b/src/views/echart/index.tsx @@ -1,6 +1,19 @@ import './index.scss' + +import { + NCard, + NSwitch, + NLayout, + NDescriptions, + NDescriptionsItem, + NTag, + NSpace, + NP, + NH6, + NH2, + NH3, +} from 'naive-ui' import RayChart from '@/components/RayChart/index' -import { NCard, NSwitch } from 'naive-ui' const Echart = defineComponent({ name: 'Echart', @@ -200,69 +213,63 @@ const Echart = defineComponent({ render() { return (
- - 在使用该组件时, 一定要注意根组件的高度初始化问题, - 如果需要使用其余的图例, 只需要从 echarts 中导入对应组件, 并且使用 use - 方法注册. 该组件实现了自动跟随模板主题切换功能, 但是动态切换损耗较大, - 所以默认不启用 - - -
- -
-
- -
- -
-
- -
- -
-
- -
- -
-
- - - {{ - checked: () => '隐藏加载动画', - unchecked: () => '显示加载动画', - }} - -
- -
-
- - - {{ - checked: () => '隐藏贴花', - unchecked: () => '显示贴花', - }} - -
- -
-
+ RayChart 组件使用 + + 该组件会默认以 200*200 + 宽高进行填充。预设了常用的图、方法组件,如果不满足需求,需要用 use + 方法进行手动拓展。该组件实现了自动跟随模板主题切换功能,但是动态切换损耗较大,所以默认不启用 + + 基础使用 +
+ +
+ 渲染成功后运行回调函数 +
+ +
+ 能跟随主题切换的可视化图 +
+ +
+ 不跟随主题切换的暗色主题可视化图 +
+ +
+ 加载动画 + + {{ + checked: () => '隐藏加载动画', + unchecked: () => '显示加载动画', + }} + +
+ +
+ 贴画可视化图 + + {{ + checked: () => '隐藏贴花', + unchecked: () => '显示贴花', + }} + +
+ +
) }, diff --git a/src/views/table/index.tsx b/src/views/table/index.tsx index 89d4bbff..139df96b 100644 --- a/src/views/table/index.tsx +++ b/src/views/table/index.tsx @@ -21,6 +21,15 @@ import { NInputNumber, NSpace, NSwitch, + NDescriptions, + NDescriptionsItem, + NP, + NH6, + NH2, + NH3, + NUl, + NLi, + NOl, } from 'naive-ui' import RayTable from '@/components/RayTable/index' import RayCollapseGrid from '@/components/RayCollapseGrid/index' @@ -147,137 +156,107 @@ const TableView = defineComponent({ render() { return ( - -

- 该组件基于 Naive UI DataTable 组件封装. 实现右键菜单, 表格标题, - 导出为 excel 操作栏等功能 -

-

RayTable 完全继承 DataTable 的所有属性与方法

-

- 相关拓展 props 属性, 可以在源码位置 + RayTable 组件使用 + + + 该组件基于 Naive UI DataTable + 组件封装。实现右键菜单、表格标题、导出为 excel 操作栏等功能 + + RayTable 完全继承 DataTable 的所有属性与方法 + + 相关拓展 props 属性,可以在源码位置 src/components/RayTable/src/props.ts 中查看相关代码与注释 -

-

该组件可以配合 RayCollapseGird 组件使用实现可折叠搜索栏

-
- + + 该组件可以配合 RayCollapseGird 组件使用实现可折叠搜索栏 + + 配合 RayCollapseGird 组件使用 + + window.$message.info( + `我是 RayCollapseGrid 组件${value ? '收起' : '展开'}的回调函数`, + ) + } + > {{ - default: () => ( - - - 该组件基于 NGird 实现, 但是由于 css grid 限制, 不能对于 - NGridItem 组件进行二次封装, 所以使用时必须配合 NGridItem - 使用才能实现示例效果(使用 NGridItem 包裹元素即可). - - - - 数量 - - - 行数 - - - - window.$message.info( - `我是 RayCollapseGrid 组件${ - value ? '收起' : '展开' - }的回调函数`, - ) - } - > - {{ - action: () => ( - <> - 搜索 - 重置 - - ), - default: () => ( - <> - - - - - - - - - - - - - - - - - ), - }} - - - ), - }} - - - (this.tableLoading = value), - }, - {}, - )} - data={this.tableData} - columns={this.baseColumns} - action={false} - pagination={{ - pageSize: 10, - }} - loading={this.tableLoading} - > - {{ - tableFooter: () => '表格的底部内容区域,有时候你可能会用上', - }} - - - - {{ - header: () => ( -
-

- 使用响应式方法代理 columns 并且打开 action - 则可以启用操作栏(v-model:columns) -

-

拖拽操作栏动态切换表格列

-

点击左右固定按钮, 即可动态固定列

-

点击修改列宽度, 即可拖动列修改宽度

-

点击导出按钮即可导出 excel 表格, 默认以列为表头输出

-

点击打印按钮即可打印该表格

-
+ action: () => ( + <> + 搜索 + 重置 + ), default: () => ( - + <> + + + + + + + + + + + + + + + + ), }} -
- - - + + (this.tableLoading = value), + }, + {}, + )} + data={this.tableData} + columns={this.baseColumns} + action={false} + pagination={{ + pageSize: 10, + }} + loading={this.tableLoading} + > + {{ + tableFooter: () => '表格的底部内容区域,有时候你可能会用上', + }} + + RayTable 拓展功能 + + 使用响应式方法代理 columns 并且打开 action + 则可以启用操作栏(v-model:columns) + + 拖拽操作栏动态切换表格列 + 点击左右固定按钮,即可动态固定列 + 点击修改列宽度,即可拖动列修改宽度 + 点击导出按钮即可导出 excel 表格,默认以列为表头输出 + 点击打印按钮即可打印该表格 + + 右键菜单 +
) },