diff --git a/examples/mixins/origin.js b/examples/mixins/origin.js index d4333d7..0fdc889 100644 --- a/examples/mixins/origin.js +++ b/examples/mixins/origin.js @@ -46,5 +46,12 @@ export default { } return newObj; }, + // 获取初始值 + getOriginData(key) { + if (key) { + return this.cloneDeep(this.originData)[key]; + } + return this.cloneDeep(this.originData); + }, }, }; diff --git a/examples/mixins/page.js b/examples/mixins/page.js index df3cbc6..69f6101 100644 --- a/examples/mixins/page.js +++ b/examples/mixins/page.js @@ -1,22 +1,21 @@ -import MIX_TOAST from '@/mixins/toast'; -import MIX_ORIGIN from '@/mixins/origin'; +import MIX_ORIGIN from '@/mixins/origin'; // 初始值逻辑混入 export default { - mixins: [MIX_TOAST, MIX_ORIGIN], + mixins: [MIX_ORIGIN], data() { return { - auto: true, - tableData: [], - loading: false, - total: 0, - currentPage: 1, - pageSize: 10, - pageSizes: [10, 20, 50, 100], - layout: 'total, sizes, prev, pager, next, jumper', - searchModel: {}, - form: {}, - submitting: false, - selection: [], + auto: true, // 页面加载时自动查询 + tableData: [], // 表格数据 + loading: false, // 加载状态 + total: 0, // 数据总量 + currentPage: 1, // 当前页码 + pageSize: 10, // 分页大小 + pageSizes: [10, 20, 50, 100], // 分页大小选项 + layout: 'total, sizes, prev, pager, next, jumper', // 分页器默认设置 + searchModel: {}, // 搜索表单绑定值 + form: {}, // 常规表单绑定值 + submitting: false, // 提交状态 + selection: [], // 表格选中项 collapsed: false, // 展开状态 }; }, @@ -94,8 +93,7 @@ export default { this.loading = true; const params = { ...this.searchModel, - currentPage: this.currentPage, - pageSize: this.pageSize, + ...this.pageParams, }; const searchAPI = this.searchAPI || this.emptyPromise; await searchAPI(params) diff --git a/examples/mixins/toast.js b/examples/mixins/toast.js deleted file mode 100644 index 3227aaa..0000000 --- a/examples/mixins/toast.js +++ /dev/null @@ -1,14 +0,0 @@ -export default { - methods: { - // 显示加载中提示框 - toast(config = {}) { - return this.$loading({ - lock: true, - text: '加载中...', - spinner: 'el-icon-loading', - customClass: 'el-loading-toast', - ...config, - }); - }, - }, -}; diff --git a/examples/router/routes.js b/examples/router/routes.js index 6e25762..47d6498 100644 --- a/examples/router/routes.js +++ b/examples/router/routes.js @@ -114,13 +114,13 @@ _components.forEach(data => { const _develops = [ { - group: '开发模式', + group: '混入开发', children: [ { - path: 'mixin', - name: 'mixin', - meta: { title: 'Mixin 混入' }, - component: () => import('@/views/docs/develop/mixin.md'), + path: 'page', + name: 'page', + meta: { title: 'Mixin Page 标准页' }, + component: () => import('@/views/docs/develop/mixin/page.md'), }, ], }, diff --git a/examples/styles/variables.scss b/examples/styles/variables.scss index dfd390e..971235f 100644 --- a/examples/styles/variables.scss +++ b/examples/styles/variables.scss @@ -1,4 +1,4 @@ -$primary: #3296fa; +$primary: #F39800; $blue: #2f54eb; $blue-light: #69c0ff; diff --git a/examples/views/docs/component/table.md b/examples/views/docs/component/table.md index 9bb6306..6a2a360 100644 --- a/examples/views/docs/component/table.md +++ b/examples/views/docs/component/table.md @@ -36,21 +36,66 @@ export default { ::: -## 可编辑表格 +## 配置项 + +可以通过配置项列表快速生成表格列 + +::: snippet 设置`columns`配置表格列,插槽`header-列字段名`可自定义表头的内容,插槽`cell-列字段名`可自定义列单元格的内容。 + +```html + + + +``` + +::: + +## 追加列 -一般用于表格的静态数据编辑 +使用配置项时,**新增的列**则默认追加在**配置项列**之后,使用`left`插槽可在表格的最左侧插入列,顺序在**配置项列**之前 -::: snippet 设置type为`editable`开启可编辑模式 +::: snippet 设置`columns`配置表格列,插槽`header-列字段名`可自定义表头的内容,插槽`cell-列字段名`可自定义列单元格的内容。 ```html