vue-super-crud 1.7.1 → 1.7.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +42 -10
- package/lib/index.css +1 -1
- package/lib/super-crud.min.js +2 -2
- package/package.json +21 -16
- package/src/config/common.js +2 -1
- package/src/config/crud.js +3 -3
- package/src/index.js +4 -0
- package/src/template/formatData.js +75 -87
- package/.browserslistrc +0 -3
- package/.versionrc.json +0 -36
- package/CHANGELOG.md +0 -232
- package/babel.config.js +0 -12
- package/build/alias.js +0 -10
- package/build/build.js +0 -52
- package/build/config.js +0 -70
- package/deploy.bat +0 -14
- package/docs/.vuepress/components/button/base.vue +0 -88
- package/docs/.vuepress/components/common/code-format.vue +0 -331
- package/docs/.vuepress/components/commonConfig/presetCodeTemplate/base.vue +0 -68
- package/docs/.vuepress/components/commonConfig/presetCodeTemplate/customParams.vue +0 -73
- package/docs/.vuepress/components/commonConfig/renderType/component.vue +0 -160
- package/docs/.vuepress/components/commonConfig/renderType/formatter.vue +0 -49
- package/docs/.vuepress/components/commonConfig/renderType/render.vue +0 -91
- package/docs/.vuepress/components/commonConfig/renderType/slot.vue +0 -63
- package/docs/.vuepress/components/crud/baseUse/baseUse.vue +0 -98
- package/docs/.vuepress/components/crud/baseUse/columnAction.vue +0 -72
- package/docs/.vuepress/components/crud/baseUse/columnWidth.vue +0 -107
- package/docs/.vuepress/components/crud/baseUse/handleRow.vue +0 -65
- package/docs/.vuepress/components/crud/baseUse/height.vue +0 -82
- package/docs/.vuepress/components/crud/baseUse/index.vue +0 -54
- package/docs/.vuepress/components/crud/baseUse/loading.vue +0 -70
- package/docs/.vuepress/components/crud/baseUse/pagination.vue +0 -108
- package/docs/.vuepress/components/crud/baseUse/selection.vue +0 -114
- package/docs/.vuepress/components/crud/baseUse/summaryMethod.vue +0 -118
- package/docs/.vuepress/components/crud/baseUse/title.vue +0 -54
- package/docs/.vuepress/components/crud/baseUse/toolbar.vue +0 -69
- package/docs/.vuepress/components/crud/buttons/common.vue +0 -115
- package/docs/.vuepress/components/crud/buttons/fast.vue +0 -82
- package/docs/.vuepress/components/crud/contextMenu/base.vue +0 -72
- package/docs/.vuepress/components/crud/copy.vue +0 -52
- package/docs/.vuepress/components/crud/crudEvents/api.vue +0 -157
- package/docs/.vuepress/components/crud/crudEvents/deleteTip.vue +0 -93
- package/docs/.vuepress/components/crud/crudEvents/events.vue +0 -188
- package/docs/.vuepress/components/crud/dataSort/base.vue +0 -142
- package/docs/.vuepress/components/crud/genDynamicColumns/base.vue +0 -53
- package/docs/.vuepress/components/crud/genDynamicColumns/dynamicAndFixed.vue +0 -111
- package/docs/.vuepress/components/crud/genDynamicColumns/treeDynamic.vue +0 -68
- package/docs/.vuepress/components/crud/handleBar/handleRow.vue +0 -65
- package/docs/.vuepress/components/crud/handleBar/toolbar.vue +0 -69
- package/docs/.vuepress/components/crud/renderType/1.vue +0 -57
- package/docs/.vuepress/components/crud/renderType/2.vue +0 -63
- package/docs/.vuepress/components/crud/renderType/3.vue +0 -105
- package/docs/.vuepress/components/crud/renderType/5.vue +0 -91
- package/docs/.vuepress/components/crud/search/1.vue +0 -90
- package/docs/.vuepress/components/crud/search/2.vue +0 -78
- package/docs/.vuepress/components/crud/search/3.vue +0 -107
- package/docs/.vuepress/components/crud/search/base.vue +0 -123
- package/docs/.vuepress/components/crud/search/localSearch.vue +0 -124
- package/docs/.vuepress/components/crud/search/special.vue +0 -148
- package/docs/.vuepress/components/crud/selection/events.vue +0 -47
- package/docs/.vuepress/components/crud/selection/pagination.vue +0 -94
- package/docs/.vuepress/components/crud/selection/singleSelection.vue +0 -64
- package/docs/.vuepress/components/crud/span/base.vue +0 -69
- package/docs/.vuepress/components/crud/span/special.vue +0 -75
- package/docs/.vuepress/components/crud/summary/base.vue +0 -99
- package/docs/.vuepress/components/crud/tableEdit/addDeleteBtn.vue +0 -174
- package/docs/.vuepress/components/crud/tableEdit/cellEdit.vue +0 -194
- package/docs/.vuepress/components/crud/tableEdit/controlEdit.vue +0 -219
- package/docs/.vuepress/components/crud/tableEdit/dialog.vue +0 -172
- package/docs/.vuepress/components/crud/tableEdit/free.vue +0 -88
- package/docs/.vuepress/components/crud/tableEdit/freeColumn.vue +0 -82
- package/docs/.vuepress/components/crud/tableEdit/methods.vue +0 -154
- package/docs/.vuepress/components/crud/tableEdit/rowAction.vue +0 -107
- package/docs/.vuepress/components/crud/tableEdit/rowBatch.vue +0 -116
- package/docs/.vuepress/components/crud/tableEdit/rowClick.vue +0 -98
- package/docs/.vuepress/components/crud/validate/base.vue +0 -122
- package/docs/.vuepress/components/crud/validate/custom.vue +0 -82
- package/docs/.vuepress/components/crud/validate/regulars.vue +0 -88
- package/docs/.vuepress/components/crud/validate/relation.vue +0 -91
- package/docs/.vuepress/components/crud/validate/tree.vue +0 -82
- package/docs/.vuepress/components/dialog/baseUse/base.vue +0 -92
- package/docs/.vuepress/components/dialog/baseUse/beforeConfirm.vue +0 -78
- package/docs/.vuepress/components/dialog/baseUse/control.vue +0 -79
- package/docs/.vuepress/components/dialog/baseUse/drawer.vue +0 -59
- package/docs/.vuepress/components/dialog/baseUse/footer.vue +0 -87
- package/docs/.vuepress/components/dialog/baseUse/insertSlot.vue +0 -79
- package/docs/.vuepress/components/dict/DictLinkage.vue +0 -91
- package/docs/.vuepress/components/dict/baseUse.vue +0 -72
- package/docs/.vuepress/components/dict/component.vue +0 -82
- package/docs/.vuepress/components/dict/localDict.vue +0 -68
- package/docs/.vuepress/components/form/baseUse/base.vue +0 -48
- package/docs/.vuepress/components/form/baseUse/dataFormat.vue +0 -92
- package/docs/.vuepress/components/form/baseUse/deep.vue +0 -57
- package/docs/.vuepress/components/form/baseUse/gridLayout.vue +0 -47
- package/docs/.vuepress/components/form/baseUse/group.vue +0 -66
- package/docs/.vuepress/components/form/baseUse/hidden.vue +0 -40
- package/docs/.vuepress/components/form/baseUse/inlineLayout.vue +0 -48
- package/docs/.vuepress/components/form/baseUse/label.vue +0 -51
- package/docs/.vuepress/components/form/baseUse/tooltip.vue +0 -40
- package/docs/.vuepress/components/form/baseUse/validate.vue +0 -52
- package/docs/.vuepress/components/form/detail/base.vue +0 -78
- package/docs/.vuepress/components/form/detail/border.vue +0 -90
- package/docs/.vuepress/components/form/detail/singleDetail.vue +0 -72
- package/docs/.vuepress/components/formatData/baseUse.vue +0 -131
- package/docs/.vuepress/components/mock/index.js +0 -347
- package/docs/.vuepress/components/mockData/custom.vue +0 -69
- package/docs/.vuepress/components/mockData/example.vue +0 -290
- package/docs/.vuepress/components/positionSlot/base.vue +0 -24
- package/docs/.vuepress/components/positionSlot/form.vue +0 -71
- package/docs/.vuepress/components/positionSlot/table.vue +0 -85
- package/docs/.vuepress/components/tabs/base.vue +0 -57
- package/docs/.vuepress/components/temp.js +0 -195
- package/docs/.vuepress/config.js +0 -146
- package/docs/.vuepress/enhanceApp.js +0 -142
- package/docs/.vuepress/public/favicon.ico +0 -0
- package/docs/.vuepress/public/super.png +0 -0
- package/docs/.vuepress/styles/index.styl +0 -25
- package/docs/.vuepress/styles/palette.styl +0 -6
- package/docs/README.md +0 -14
- package/docs/guide/button/base.md +0 -31
- package/docs/guide/commonConfig/jsx.md +0 -166
- package/docs/guide/commonConfig/presetCodeTemplate.md +0 -68
- package/docs/guide/commonConfig/renderType.md +0 -181
- package/docs/guide/crud/baseUse.md +0 -120
- package/docs/guide/crud/buttons.md +0 -18
- package/docs/guide/crud/config.md +0 -217
- package/docs/guide/crud/contextMenu.md +0 -18
- package/docs/guide/crud/dataSort.md +0 -66
- package/docs/guide/crud/genDynamicColumns.md +0 -145
- package/docs/guide/crud/handleBar.md +0 -26
- package/docs/guide/crud/renderType.md +0 -4
- package/docs/guide/crud/search.md +0 -150
- package/docs/guide/crud/selection.md +0 -73
- package/docs/guide/crud/span.md +0 -98
- package/docs/guide/crud/summary.md +0 -167
- package/docs/guide/crud/tableEdit.md +0 -377
- package/docs/guide/crud/validate.md +0 -158
- package/docs/guide/dialog/baseUse.md +0 -81
- package/docs/guide/dict/baseUse.md +0 -174
- package/docs/guide/dict/component.md +0 -88
- package/docs/guide/dict/config.md +0 -44
- package/docs/guide/form/baseUse.md +0 -142
- package/docs/guide/form/detail.md +0 -38
- package/docs/guide/formatData/baseUse.md +0 -98
- package/docs/guide/formatData/config.md +0 -142
- package/docs/guide/mockData/base.md +0 -26
- package/docs/guide/positionSlot/base.md +0 -41
- package/docs/guide/question/base.md +0 -44
- package/docs/guide/start/base.md +0 -30
- package/docs/guide/tabs/base.md +0 -63
- package/examples/App.vue +0 -52
- package/examples/Layout/components/AppMain.vue +0 -40
- package/examples/Layout/components/Item.vue +0 -29
- package/examples/Layout/components/Link.vue +0 -44
- package/examples/Layout/components/SidebarItem.vue +0 -93
- package/examples/Layout/index.vue +0 -69
- package/examples/assets/logo.png +0 -0
- package/examples/favicon.ico +0 -0
- package/examples/index.html +0 -18
- package/examples/main.js +0 -54
- package/examples/router/index.js +0 -140
- package/examples/store/index.js +0 -0
- package/examples/styles/index.scss +0 -63
- package/examples/styles/sidebar.scss +0 -226
- package/examples/styles/transition.scss +0 -48
- package/examples/styles/variables.scss +0 -25
- package/examples/views/crud/base.vue +0 -68
- package/examples/views/crud/handleRow.vue +0 -84
- package/examples/views/crud/search.vue +0 -116
- package/examples/views/dashboard/index.vue +0 -244
- package/examples/views/dashboard/index1.vue +0 -234
- package/examples/views/dashboard/test.vue +0 -9
- package/examples/views/formTest/index.vue +0 -168
- package/examples/views/nested/menu1/index.vue +0 -7
- package/examples/views/nested/menu1/menu1-1/index.vue +0 -7
- package/examples/views/nested/menu1/menu1-2/index.vue +0 -7
- package/examples/views/nested/menu1/menu1-2/menu1-2-1/index.vue +0 -5
- package/examples/views/nested/menu1/menu1-2/menu1-2-2/index.vue +0 -5
- package/examples/views/nested/menu1/menu1-3/index.vue +0 -5
- package/examples/views/nested/menu2/index.vue +0 -5
- package/gulpfile.js +0 -84
- package/packages/button/index.vue +0 -189
- package/packages/core/components/comp.vue +0 -223
- package/packages/core/components/position.vue +0 -135
- package/packages/core/components/render.vue +0 -460
- package/packages/core/configManager.js +0 -302
- package/packages/core/create.js +0 -8
- package/packages/core/defaultRender.js +0 -64
- package/packages/core/dict/global.js +0 -10
- package/packages/core/dict/index.js +0 -432
- package/packages/core/dict/mixin.js +0 -94
- package/packages/core/event.js +0 -60
- package/packages/core/index.js +0 -6
- package/packages/core/init.js +0 -122
- package/packages/core/mock/genConfig.js +0 -228
- package/packages/core/mock/genData.js +0 -422
- package/packages/core/mock/index.js +0 -4
- package/packages/core/rules.js +0 -111
- package/packages/crud/column.vue +0 -205
- package/packages/crud/columnAction.vue +0 -207
- package/packages/crud/columnCell.vue +0 -146
- package/packages/crud/defaultColumn.vue +0 -130
- package/packages/crud/drawerColumn.vue +0 -225
- package/packages/crud/form.vue +0 -69
- package/packages/crud/index.vue +0 -564
- package/packages/crud/menuBar.vue +0 -298
- package/packages/crud/mixins/cacheHandler.js +0 -36
- package/packages/crud/mixins/calcColumnWidth.js +0 -79
- package/packages/crud/mixins/calcHeight.js +0 -105
- package/packages/crud/mixins/columnHandler.js +0 -128
- package/packages/crud/mixins/contextMenu.js +0 -98
- package/packages/crud/mixins/dataProcessor.js +0 -202
- package/packages/crud/mixins/dialog.js +0 -109
- package/packages/crud/mixins/excelHandler.js +0 -150
- package/packages/crud/mixins/exposeMethods.js +0 -107
- package/packages/crud/mixins/generateDynamicColumns.js +0 -250
- package/packages/crud/mixins/props.js +0 -38
- package/packages/crud/mixins/searchHandler.js +0 -151
- package/packages/crud/mixins/select.js +0 -359
- package/packages/crud/mixins/spanMethod.js +0 -288
- package/packages/crud/mixins/summary.js +0 -177
- package/packages/crud/mixins/tableEdit.js +0 -547
- package/packages/crud/mixins/validate.js +0 -219
- package/packages/crud/pagination.vue +0 -110
- package/packages/crud/search.vue +0 -119
- package/packages/crud/searchHeader.vue +0 -231
- package/packages/crud/selectBanner.vue +0 -138
- package/packages/crud/utils/EditState.js +0 -319
- package/packages/crud/utils/excelExport.js +0 -112
- package/packages/crud/utils/excelImport.js +0 -112
- package/packages/crud/utils/index.js +0 -98
- package/packages/dialog/dialog.js +0 -233
- package/packages/dialog/dialog.vue +0 -15
- package/packages/dialog/index.js +0 -22
- package/packages/dict/cascadeFormat.vue +0 -179
- package/packages/dict/dateFormat.vue +0 -40
- package/packages/dict/form/cascade.vue +0 -61
- package/packages/dict/form/checkbox.vue +0 -90
- package/packages/dict/form/extendMethod.js +0 -22
- package/packages/dict/form/input-base.js +0 -31
- package/packages/dict/form/input.js +0 -20
- package/packages/dict/form/radio.vue +0 -69
- package/packages/dict/form/select.vue +0 -118
- package/packages/dict/form/switch.vue +0 -75
- package/packages/dict/valueFormat.vue +0 -188
- package/packages/directive/dialog/drag.js +0 -86
- package/packages/directive/dialog/dragSize.js +0 -42
- package/packages/directive/index.js +0 -9
- package/packages/directive/insertSlot.js +0 -10
- package/packages/form/contextMenu.js +0 -192
- package/packages/form/draftDrawer.vue +0 -391
- package/packages/form/formAction.vue +0 -97
- package/packages/form/formItem.vue +0 -259
- package/packages/form/index.vue +0 -451
- package/packages/form/props.js +0 -15
- package/packages/grid/cell.vue +0 -65
- package/packages/grid/index.vue +0 -130
- package/packages/group/index.vue +0 -96
- package/packages/tabs/index.vue +0 -290
- package/packages/tooltip/index.js +0 -9
- package/packages/tooltip/tooltip.vue +0 -32
- package/packages/tooltip/tooltipComponent.js +0 -38
- package/packages/verifyInput/index.vue +0 -131
- package/styles/button.scss +0 -3
- package/styles/crud.scss +0 -425
- package/styles/dialog.scss +0 -95
- package/styles/form.scss +0 -532
- package/styles/group.scss +0 -78
- package/styles/index.scss +0 -94
- package/styles/tabs.scss +0 -139
- package/styles/verifyInput.scss +0 -56
- package/vue-jsx-sync.js +0 -90
- package/vue.config.js +0 -54
@@ -1,142 +0,0 @@
|
|
1
|
-
// // enhanceApp.js
|
2
|
-
// import VueHighlightJS from "vue-highlight.js";
|
3
|
-
import "highlight.js/styles/atom-one-dark.css";
|
4
|
-
// import ElementUI from "element-ui";
|
5
|
-
import "element-ui/lib/theme-chalk/index.css";
|
6
|
-
// // import Package from "../../lib/sc-crud";
|
7
|
-
// // import "../../lib/index.css";
|
8
|
-
// import Package from "../../src/index";
|
9
|
-
// // import Contextmenu from "vue-contextmenujs";
|
10
|
-
import "../../styles/index.scss";
|
11
|
-
|
12
|
-
export default async ({ Vue }) => {
|
13
|
-
if (typeof window !== "undefined") {
|
14
|
-
// 动态导入插件
|
15
|
-
const [
|
16
|
-
{ default: VueHighlightJS },
|
17
|
-
{ default: ElementUI },
|
18
|
-
{ default: Package },
|
19
|
-
{ default: Contextmenu },
|
20
|
-
] = await Promise.all([
|
21
|
-
import("vue-highlight.js"),
|
22
|
-
import("element-ui"),
|
23
|
-
import("../../src/index"),
|
24
|
-
import("vue-contextmenujs"),
|
25
|
-
]);
|
26
|
-
|
27
|
-
// // 导入样式
|
28
|
-
// await Promise.all([
|
29
|
-
// import("highlight.js/styles/atom-one-dark.css"),
|
30
|
-
// import("element-ui/lib/theme-chalk/index.css"),
|
31
|
-
// import("../../lib/index.css"),
|
32
|
-
// ]);
|
33
|
-
|
34
|
-
Vue.use(VueHighlightJS);
|
35
|
-
Vue.use(ElementUI, {
|
36
|
-
size: "small",
|
37
|
-
});
|
38
|
-
Vue.use(Package, {
|
39
|
-
crudOptions: {
|
40
|
-
gap: 0,
|
41
|
-
border: true,
|
42
|
-
},
|
43
|
-
dict: {
|
44
|
-
request: (key) => {
|
45
|
-
const data = {
|
46
|
-
cascade: [
|
47
|
-
{
|
48
|
-
label: "选项1",
|
49
|
-
value: "1",
|
50
|
-
children: [
|
51
|
-
{
|
52
|
-
label: "选项1-1",
|
53
|
-
value: "1-1",
|
54
|
-
},
|
55
|
-
{
|
56
|
-
label: "选项1-2",
|
57
|
-
value: "1-2",
|
58
|
-
},
|
59
|
-
],
|
60
|
-
},
|
61
|
-
{
|
62
|
-
label: "选项2",
|
63
|
-
value: "2",
|
64
|
-
},
|
65
|
-
],
|
66
|
-
gender: [
|
67
|
-
{
|
68
|
-
label: "男",
|
69
|
-
value: "1",
|
70
|
-
},
|
71
|
-
{
|
72
|
-
label: "女",
|
73
|
-
value: "2",
|
74
|
-
},
|
75
|
-
],
|
76
|
-
gender1: [
|
77
|
-
{
|
78
|
-
label: "男",
|
79
|
-
value: "1",
|
80
|
-
},
|
81
|
-
{
|
82
|
-
label: "女",
|
83
|
-
value: "2",
|
84
|
-
},
|
85
|
-
],
|
86
|
-
};
|
87
|
-
return Promise.resolve({ data: data[key] });
|
88
|
-
},
|
89
|
-
},
|
90
|
-
template: {
|
91
|
-
crud: {
|
92
|
-
uniqueId: true,
|
93
|
-
handleRow: {
|
94
|
-
tempGlobalButton: {
|
95
|
-
label: "自定义temp按钮",
|
96
|
-
icon: "el-icon-eleme",
|
97
|
-
onClick: () => {
|
98
|
-
console.log("自定义temp按钮");
|
99
|
-
},
|
100
|
-
},
|
101
|
-
},
|
102
|
-
},
|
103
|
-
dicts: {
|
104
|
-
getList: (item) => ({
|
105
|
-
request: (params, done) => {
|
106
|
-
const data = [
|
107
|
-
{
|
108
|
-
label: "男",
|
109
|
-
value: "1",
|
110
|
-
},
|
111
|
-
{
|
112
|
-
label: "女",
|
113
|
-
value: "2",
|
114
|
-
},
|
115
|
-
];
|
116
|
-
setTimeout(() => {
|
117
|
-
done(data);
|
118
|
-
}, 500);
|
119
|
-
},
|
120
|
-
}),
|
121
|
-
},
|
122
|
-
render: {
|
123
|
-
testCodeTemplate: (item) => ({
|
124
|
-
search: {
|
125
|
-
comp: {
|
126
|
-
name: item.searchCompName,
|
127
|
-
type: item.SearchCompType,
|
128
|
-
},
|
129
|
-
},
|
130
|
-
form: {
|
131
|
-
comp: {
|
132
|
-
name: item.formCompName,
|
133
|
-
},
|
134
|
-
},
|
135
|
-
formatter: (row) => row[item.prop] + "自定义格式化",
|
136
|
-
}),
|
137
|
-
},
|
138
|
-
},
|
139
|
-
});
|
140
|
-
Vue.use(Contextmenu);
|
141
|
-
}
|
142
|
-
};
|
Binary file
|
Binary file
|
@@ -1,25 +0,0 @@
|
|
1
|
-
.dark .content__default code {
|
2
|
-
background-color: rgba(57, 197, 187, 1);
|
3
|
-
}
|
4
|
-
.page {
|
5
|
-
transform: unset !important;
|
6
|
-
overflow: visible !important;
|
7
|
-
}
|
8
|
-
.page-title {
|
9
|
-
display: none
|
10
|
-
}
|
11
|
-
.language-vue {
|
12
|
-
border-radius: 0 !important;
|
13
|
-
}
|
14
|
-
|
15
|
-
.el-table__expand-icon>.el-icon {
|
16
|
-
margin-top: -5px !important;
|
17
|
-
}
|
18
|
-
.el-table tr {
|
19
|
-
background-color: #fff !important;
|
20
|
-
}
|
21
|
-
|
22
|
-
.content {
|
23
|
-
margin: 0 !important;
|
24
|
-
padding: 0 !important;
|
25
|
-
}
|
package/docs/README.md
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
---
|
2
|
-
home: true
|
3
|
-
heroImage: /super.png
|
4
|
-
actionText: 快速上手 →
|
5
|
-
actionLink: /guide/start/base.md
|
6
|
-
features:
|
7
|
-
- title: 快速开发
|
8
|
-
details: 极少的代码即可完成一个crud页面。
|
9
|
-
- title: 模板复用
|
10
|
-
details: 配置并复用代码模板,减少重复开发,提升开发效率。
|
11
|
-
- title: 高度自定义
|
12
|
-
details: 灵活、丰富的配置,以满足不同项目的高度自定义需求
|
13
|
-
footer: MIT Licensed | Copyright © 2019-2020 present Greper
|
14
|
-
---
|
@@ -1,31 +0,0 @@
|
|
1
|
-
# 基本使用
|
2
|
-
|
3
|
-
## 概述
|
4
|
-
|
5
|
-
基于 el-button 的增强型按钮组件,提供了防抖、确认框、下拉菜单等多种交互功能。
|
6
|
-
|
7
|
-
## 示例
|
8
|
-
|
9
|
-
<ClientOnly>
|
10
|
-
<common-code-format>
|
11
|
-
<button-base slot="source"></button-base>
|
12
|
-
|
13
|
-
<<< @/docs/.vuepress/components/button/base.vue
|
14
|
-
</common-code-format>
|
15
|
-
</ClientOnly>
|
16
|
-
|
17
|
-
## API
|
18
|
-
|
19
|
-
| 属性 | 说明 | 类型 | 默认值 |
|
20
|
-
| ------------- | ---------------- | --------------------- | ------ |
|
21
|
-
| type | 按钮类型 | String | - |
|
22
|
-
| size | 按钮大小 | String | mini |
|
23
|
-
| disabled | 是否禁用 | Boolean | false |
|
24
|
-
| label | 按钮文本 | String | - |
|
25
|
-
| hidden | 是否隐藏 | Boolean | - |
|
26
|
-
| show | 是否显示 | Boolean | - |
|
27
|
-
| children | 下拉菜单项 | Array | - |
|
28
|
-
| time | 防抖时间(ms) | Number | 300 |
|
29
|
-
| confirm | 确认框配置 | Boolean/String/Object | - |
|
30
|
-
| customConfirm | 自定义确认框配置 | Object | - |
|
31
|
-
| textSubmit | 文本提交配置 | Object | - |
|
@@ -1,166 +0,0 @@
|
|
1
|
-
# JSX 语法
|
2
|
-
|
3
|
-
## 内容
|
4
|
-
|
5
|
-
```jsx
|
6
|
-
render() {
|
7
|
-
return <p>hello</p>
|
8
|
-
}
|
9
|
-
```
|
10
|
-
|
11
|
-
### 具有动态内容:
|
12
|
-
|
13
|
-
```jsx
|
14
|
-
render() {
|
15
|
-
return <p>hello { this.message }</p>
|
16
|
-
}
|
17
|
-
```
|
18
|
-
|
19
|
-
### 单标签:
|
20
|
-
|
21
|
-
```jsx
|
22
|
-
render() {
|
23
|
-
return <input />
|
24
|
-
}
|
25
|
-
```
|
26
|
-
|
27
|
-
### 使用组件:
|
28
|
-
|
29
|
-
```jsx
|
30
|
-
import MyComponent from './my-component'
|
31
|
-
|
32
|
-
export default {
|
33
|
-
render() {
|
34
|
-
return <MyComponent>hello</MyComponent>
|
35
|
-
},
|
36
|
-
}
|
37
|
-
```
|
38
|
-
|
39
|
-
## 属性
|
40
|
-
|
41
|
-
```jsx
|
42
|
-
render() {
|
43
|
-
return <input type="email" />
|
44
|
-
}
|
45
|
-
```
|
46
|
-
|
47
|
-
### 使用动态绑定:
|
48
|
-
|
49
|
-
```jsx
|
50
|
-
render() {
|
51
|
-
return <input
|
52
|
-
type="email"
|
53
|
-
placeholder={this.placeholderText}
|
54
|
-
/>
|
55
|
-
}
|
56
|
-
```
|
57
|
-
|
58
|
-
### 绑定事件:
|
59
|
-
|
60
|
-
```jsx
|
61
|
-
render() {
|
62
|
-
return <input onInput={this.handleInput} />
|
63
|
-
}
|
64
|
-
```
|
65
|
-
|
66
|
-
### 动态绑定事件:
|
67
|
-
|
68
|
-
```jsx
|
69
|
-
render() {
|
70
|
-
const events = {
|
71
|
-
"visible-change": () => {
|
72
|
-
console.log("visible-change");
|
73
|
-
},
|
74
|
-
}
|
75
|
-
return <input on={events} />
|
76
|
-
}
|
77
|
-
```
|
78
|
-
|
79
|
-
|
80
|
-
### 动态属性:
|
81
|
-
|
82
|
-
```jsx
|
83
|
-
render() {
|
84
|
-
const props = {
|
85
|
-
type: 'email',
|
86
|
-
placeholder: 'Enter your email'
|
87
|
-
}
|
88
|
-
|
89
|
-
return <input props={props} />
|
90
|
-
}
|
91
|
-
```
|
92
|
-
|
93
|
-
### 使用扩展运算符:
|
94
|
-
|
95
|
-
```jsx
|
96
|
-
render() {
|
97
|
-
const inputAttrs = {
|
98
|
-
type: 'email',
|
99
|
-
placeholder: 'Enter your email'
|
100
|
-
}
|
101
|
-
|
102
|
-
return <input {...{ attrs: inputAttrs }} />
|
103
|
-
}
|
104
|
-
```
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
## 插槽
|
109
|
-
|
110
|
-
### 命名插槽:
|
111
|
-
|
112
|
-
```jsx
|
113
|
-
render() {
|
114
|
-
return (
|
115
|
-
<MyComponent>
|
116
|
-
<header slot="header">header</header>
|
117
|
-
<footer slot="footer">footer</footer>
|
118
|
-
</MyComponent>
|
119
|
-
)
|
120
|
-
}
|
121
|
-
```
|
122
|
-
|
123
|
-
### 作用域插槽:
|
124
|
-
|
125
|
-
```jsx
|
126
|
-
render() {
|
127
|
-
const scopedSlots = {
|
128
|
-
header: () => <header>header</header>,
|
129
|
-
footer: () => <footer>footer</footer>
|
130
|
-
}
|
131
|
-
|
132
|
-
return <MyComponent scopedSlots={scopedSlots} />
|
133
|
-
}
|
134
|
-
```
|
135
|
-
|
136
|
-
## 指令
|
137
|
-
|
138
|
-
```jsx
|
139
|
-
<input vModel={this.newTodoText} />
|
140
|
-
// or
|
141
|
-
<input v-model={this.newTodoText} />
|
142
|
-
```
|
143
|
-
|
144
|
-
### 使用修饰符:
|
145
|
-
|
146
|
-
```jsx
|
147
|
-
<input vModel_trim={this.newTodoText} />
|
148
|
-
```
|
149
|
-
|
150
|
-
### 带有参数:
|
151
|
-
|
152
|
-
```jsx
|
153
|
-
<input vOn:click={this.newTodoText} />
|
154
|
-
```
|
155
|
-
|
156
|
-
### 带有参数和修饰符:
|
157
|
-
|
158
|
-
```jsx
|
159
|
-
<input vOn:click_stop_prevent={this.newTodoText} />
|
160
|
-
```
|
161
|
-
|
162
|
-
### v-html:
|
163
|
-
|
164
|
-
```jsx
|
165
|
-
<p domPropsInnerHTML={html} />
|
166
|
-
```
|
@@ -1,68 +0,0 @@
|
|
1
|
-
# 预设配置模板
|
2
|
-
|
3
|
-
## 基本使用
|
4
|
-
|
5
|
-
`presetType` 匹配预设的配置,实现配置复用。</br>
|
6
|
-
|
7
|
-
通用`presetType` 匹配到的配置对象会与原有的配置合并,形成一个新的配置对象,达到配置复用的效果。
|
8
|
-
|
9
|
-
<ClientOnly>
|
10
|
-
<common-code-format>
|
11
|
-
<commonConfig-presetCodeTemplate-base slot="source"></commonConfig-presetCodeTemplate-base>
|
12
|
-
|
13
|
-
<<< @/docs/.vuepress/components/commonConfig/presetCodeTemplate/base.vue
|
14
|
-
</common-code-format>
|
15
|
-
</ClientOnly>
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
## 预设配置的动态化
|
20
|
-
|
21
|
-
预设的配置如果是一个函数,接收的参数为原有的配置对象`item`,可以动态的返回一个配置对象,实现配置的动态化。
|
22
|
-
|
23
|
-
<ClientOnly>
|
24
|
-
<common-code-format>
|
25
|
-
<commonConfig-presetCodeTemplate-customParams slot="source"></commonConfig-presetCodeTemplate-customParams>
|
26
|
-
|
27
|
-
<<< @/docs/.vuepress/components/commonConfig/presetCodeTemplate/customParams.vue
|
28
|
-
</common-code-format>
|
29
|
-
</ClientOnly>
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
# 自定义预设配置
|
34
|
-
|
35
|
-
::: tip
|
36
|
-
在全局配置对象 `template` 下添加新的预设配置 。
|
37
|
-
:::
|
38
|
-
|
39
|
-
```js
|
40
|
-
|
41
|
-
Vue.use(superCrud, {
|
42
|
-
template: {
|
43
|
-
render: { // 渲染模板
|
44
|
-
dateRange: () => ({
|
45
|
-
comp: {
|
46
|
-
name: "el-date-picker",
|
47
|
-
type: "daterange",
|
48
|
-
"range-separator": "-",
|
49
|
-
"start-placeholder": "开始",
|
50
|
-
"end-placeholder": "结束",
|
51
|
-
valueFormat: "yyyy-MM-dd",
|
52
|
-
},
|
53
|
-
}),
|
54
|
-
},
|
55
|
-
rules: { // 校验模板
|
56
|
-
required: (rules, { item }) => {
|
57
|
-
return {
|
58
|
-
required: true,
|
59
|
-
message: item.label + "不能为空",
|
60
|
-
trigger: item.rules.trigger,
|
61
|
-
};
|
62
|
-
},
|
63
|
-
},
|
64
|
-
dict: { // 字典模板
|
65
|
-
...
|
66
|
-
},
|
67
|
-
}})
|
68
|
-
```
|
@@ -1,181 +0,0 @@
|
|
1
|
-
# 渲染方式
|
2
|
-
|
3
|
-
## 格式化渲染
|
4
|
-
|
5
|
-
`formatter` 用于格式化数据,返回处理后的文本内容 </br>
|
6
|
-
`html` 配合 formatter 使用,可以渲染 HTML 字符串
|
7
|
-
|
8
|
-
<ClientOnly>
|
9
|
-
<common-code-format>
|
10
|
-
<commonConfig-renderType-formatter slot="source"></commonConfig-renderType-formatter>
|
11
|
-
<<< @/docs/.vuepress/components/commonConfig/renderType/formatter.vue
|
12
|
-
</common-code-format>
|
13
|
-
</ClientOnly>
|
14
|
-
|
15
|
-
## 插槽渲染
|
16
|
-
|
17
|
-
`#[prop]` 插槽名称与 renderColumns 的 prop 属性对应 </br>
|
18
|
-
插槽可以接收`scope`作为作用域参数
|
19
|
-
|
20
|
-
<ClientOnly>
|
21
|
-
<common-code-format>
|
22
|
-
<commonConfig-renderType-slot slot="source"></commonConfig-renderType-slot>
|
23
|
-
<<< @/docs/.vuepress/components/commonConfig/renderType/slot.vue
|
24
|
-
</common-code-format>
|
25
|
-
</ClientOnly>
|
26
|
-
|
27
|
-
## render函数渲染
|
28
|
-
|
29
|
-
使用 render 函数或 JSX 语法进行渲染 </br>
|
30
|
-
当 render 函数接收一个参数时,参数为`scope`;当 render 函数接收两个参数时,第一个参数为`h`,第二个参数为`scope`
|
31
|
-
|
32
|
-
<ClientOnly>
|
33
|
-
<common-code-format>
|
34
|
-
<commonConfig-renderType-render slot="source"></commonConfig-renderType-render>
|
35
|
-
<<< @/docs/.vuepress/components/commonConfig/renderType/render.vue
|
36
|
-
</common-code-format>
|
37
|
-
</ClientOnly>
|
38
|
-
|
39
|
-
## 组件配置渲染
|
40
|
-
|
41
|
-
通过配置对象`comp`来定义组件的各种行为和属性 </br>
|
42
|
-
|
43
|
-
默认配置:
|
44
|
-
- clearable: 默认为 true </br>
|
45
|
-
- placeholder: 默认为"请输入/请选择" + 列标签 </br>
|
46
|
-
- size: 继承父组件的 size 配置 </br>
|
47
|
-
|
48
|
-
<ClientOnly>
|
49
|
-
<common-code-format>
|
50
|
-
<commonConfig-renderType-component slot="source"></commonConfig-renderType-component>
|
51
|
-
<<< @/docs/.vuepress/components/commonConfig/renderType/component.vue
|
52
|
-
</common-code-format>
|
53
|
-
</ClientOnly>
|
54
|
-
|
55
|
-
### 组件类型转换
|
56
|
-
|
57
|
-
原先名字为 el-select 的组件会转化为封装的 sc-select 组件,支持 options 配置, 快速生成选项,[字典组件配置](/guide/dict/component.html#字典组件配置)
|
58
|
-
|
59
|
-
| 原组件 | 转换后组件 |
|
60
|
-
| ----------------- | ----------- |
|
61
|
-
| el-select | sc-select |
|
62
|
-
| el-checkbox-group | sc-checkbox |
|
63
|
-
| el-radio-group | sc-radio |
|
64
|
-
| el-switch | sc-switch |
|
65
|
-
| el-cascader | sc-cascader |
|
66
|
-
|
67
|
-
### 组件属性设置
|
68
|
-
支持两种方式设置组件属性:
|
69
|
-
1. 直接属性配置
|
70
|
-
```js
|
71
|
-
{
|
72
|
-
name: 'el-input',
|
73
|
-
type: 'text',
|
74
|
-
placeholder: '请输入',
|
75
|
-
clearable: true
|
76
|
-
}
|
77
|
-
```
|
78
|
-
|
79
|
-
2. bind 配置,支持函数形式,可获取 scope 参数
|
80
|
-
```js
|
81
|
-
{
|
82
|
-
name: 'el-input',
|
83
|
-
bind: {
|
84
|
-
placeholder: '请输入',
|
85
|
-
clearable: true
|
86
|
-
}
|
87
|
-
}
|
88
|
-
```
|
89
|
-
|
90
|
-
### 事件处理配置
|
91
|
-
|
92
|
-
组件支持两种事件配置方式:
|
93
|
-
|
94
|
-
1. on 对象配置
|
95
|
-
```js
|
96
|
-
{
|
97
|
-
name: 'el-input',
|
98
|
-
on: {
|
99
|
-
change: (val, scope) => {
|
100
|
-
console.log('值变化:', val)
|
101
|
-
},
|
102
|
-
input: (val, scope) => {
|
103
|
-
console.log('输入值:', val)
|
104
|
-
}
|
105
|
-
}
|
106
|
-
}
|
107
|
-
```
|
108
|
-
|
109
|
-
2. on 前缀配置
|
110
|
-
```js
|
111
|
-
{
|
112
|
-
name: 'el-input',
|
113
|
-
onChange: (val, scope) => {
|
114
|
-
console.log('值变化:', val)
|
115
|
-
},
|
116
|
-
onInput: (val, scope) => {
|
117
|
-
console.log('输入值:', val)
|
118
|
-
}
|
119
|
-
}
|
120
|
-
```
|
121
|
-
|
122
|
-
### children 属性详细说明
|
123
|
-
|
124
|
-
children 属性用于配置组件的子元素,支持多种配置方式,常用于下拉选择、单选组、复选组等需要子组件、子元素的场景。
|
125
|
-
|
126
|
-
1. 返回子组件,支持数组与对象
|
127
|
-
```js
|
128
|
-
{
|
129
|
-
name: 'el-select',
|
130
|
-
children: [
|
131
|
-
{ name: 'el-option', label: '选项1', value: 1 },
|
132
|
-
{ name: 'el-option', label: '选项2', value: 2 }
|
133
|
-
] // { name: 'el-option', label: '选项1', value: 1 }
|
134
|
-
}
|
135
|
-
```
|
136
|
-
|
137
|
-
2. 函数形式
|
138
|
-
```js
|
139
|
-
{
|
140
|
-
name: 'el-select',
|
141
|
-
children: (scope) => {
|
142
|
-
return scope.dict.map(item => ({
|
143
|
-
name: 'el-option',
|
144
|
-
label: item.label,
|
145
|
-
value: item.value
|
146
|
-
}))
|
147
|
-
}
|
148
|
-
}
|
149
|
-
|
150
|
-
```
|
151
|
-
|
152
|
-
3. 返回子元素
|
153
|
-
```js
|
154
|
-
{
|
155
|
-
name: 'el-button',
|
156
|
-
children: '按钮'
|
157
|
-
}
|
158
|
-
|
159
|
-
```
|
160
|
-
|
161
|
-
## comp 配置项
|
162
|
-
|
163
|
-
| 配置项 | 类型 | 说明 | 示例 |
|
164
|
-
| -------- | --------------------- | -------------------------------------------------- | ------------------------------------------ |
|
165
|
-
| name | String/Component | 组件名称或组件对象。字符串时必须为已注册的全局组件 | 'el-input' 或 导入的组件 |
|
166
|
-
| bind | Object/Function | 组件的属性配置,函数时可获取 scope 参数 | {placeholder: '请输入'} 或 (scope) => ({}) |
|
167
|
-
| on | Object | 组件的事件监听配置 | {change: (val, scope) => {}} |
|
168
|
-
| slots | Object | 组件的插槽配置,接收render函数 | {default: (h, scope) => []} |
|
169
|
-
| children | Array/Object/Function | 子组件配置或默认插槽内容 | [{name: 'el-option'}] |
|
170
|
-
| nativeOn | Object | 原生事件监听 | {click: () => {}} |
|
171
|
-
| mounted | Function(scope, ref) | 组件挂载后调用 | (scope, ref) => {} |
|
172
|
-
|
173
|
-
|
174
|
-
## scope 作用域对象
|
175
|
-
|
176
|
-
| 属性 | 说明 |
|
177
|
-
| ------ | -------------------------------------------------------- |
|
178
|
-
| row | 当前行数据 |
|
179
|
-
| self | 当前组件实例 |
|
180
|
-
| dict | 字典数据 |
|
181
|
-
| $value | 格式化值的 get/set,{ get: () => {} , set: (val) => {} } |
|