pit-docs-mcp 1.0.2
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 +180 -0
- package/dist/codegen.d.ts +5 -0
- package/dist/codegen.d.ts.map +1 -0
- package/dist/codegen.js +112 -0
- package/dist/constants.d.ts +6 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +10 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +115 -0
- package/dist/resources.d.ts +3 -0
- package/dist/resources.d.ts.map +1 -0
- package/dist/resources.js +80 -0
- package/dist/tools.d.ts +3 -0
- package/dist/tools.d.ts.map +1 -0
- package/dist/tools.js +258 -0
- package/dist/utils.d.ts +26 -0
- package/dist/utils.d.ts.map +1 -0
- package/dist/utils.js +198 -0
- package/docs/codegen/pit-simplify-web.md +686 -0
- package/docs/pitBusinessUi/README.md +102 -0
- package/docs/pitBusinessUi/add-date-picker.md +57 -0
- package/docs/pitBusinessUi/add-operation.md +64 -0
- package/docs/pitBusinessUi/batch-download.md +44 -0
- package/docs/pitBusinessUi/bill-tree-dialog.md +82 -0
- package/docs/pitBusinessUi/collapse.md +88 -0
- package/docs/pitBusinessUi/date-time-picker.md +74 -0
- package/docs/pitBusinessUi/design-report-explain.md +47 -0
- package/docs/pitBusinessUi/dialog.md +89 -0
- package/docs/pitBusinessUi/dic-radio.md +67 -0
- package/docs/pitBusinessUi/dic.md +78 -0
- package/docs/pitBusinessUi/document-preview.md +54 -0
- package/docs/pitBusinessUi/drawer.md +67 -0
- package/docs/pitBusinessUi/editor.md +63 -0
- package/docs/pitBusinessUi/expand-search-form.md +65 -0
- package/docs/pitBusinessUi/file-preview.md +56 -0
- package/docs/pitBusinessUi/flow-table-status.md +47 -0
- package/docs/pitBusinessUi/icon-box.md +74 -0
- package/docs/pitBusinessUi/image-preview.md +55 -0
- package/docs/pitBusinessUi/image.md +53 -0
- package/docs/pitBusinessUi/input-formatter.md +100 -0
- package/docs/pitBusinessUi/input-number.md +47 -0
- package/docs/pitBusinessUi/input-select.md +68 -0
- package/docs/pitBusinessUi/input.md +56 -0
- package/docs/pitBusinessUi/jm-preview.md +47 -0
- package/docs/pitBusinessUi/json-editor.md +71 -0
- package/docs/pitBusinessUi/loading-btn.md +64 -0
- package/docs/pitBusinessUi/monaco.md +82 -0
- package/docs/pitBusinessUi/money-input.md +59 -0
- package/docs/pitBusinessUi/pagination.md +70 -0
- package/docs/pitBusinessUi/password-strength.md +59 -0
- package/docs/pitBusinessUi/positive-number.md +63 -0
- package/docs/pitBusinessUi/preview-image.md +62 -0
- package/docs/pitBusinessUi/preview-office.md +50 -0
- package/docs/pitBusinessUi/preview.md +57 -0
- package/docs/pitBusinessUi/quill.md +52 -0
- package/docs/pitBusinessUi/runflow-btn.md +52 -0
- package/docs/pitBusinessUi/search-date-picker.md +60 -0
- package/docs/pitBusinessUi/select-bid-list.md +66 -0
- package/docs/pitBusinessUi/select-color.md +38 -0
- package/docs/pitBusinessUi/select-contract-tree.md +41 -0
- package/docs/pitBusinessUi/select-dept.md +38 -0
- package/docs/pitBusinessUi/select-project-unit.md +48 -0
- package/docs/pitBusinessUi/select-section-tree.md +45 -0
- package/docs/pitBusinessUi/select-section.md +66 -0
- package/docs/pitBusinessUi/select-string.md +60 -0
- package/docs/pitBusinessUi/select-system-unit.md +41 -0
- package/docs/pitBusinessUi/select-user-by-role.md +51 -0
- package/docs/pitBusinessUi/switch.md +43 -0
- package/docs/pitBusinessUi/table-contract.md +66 -0
- package/docs/pitBusinessUi/table-operation.md +81 -0
- package/docs/pitBusinessUi/table.md +75 -0
- package/docs/pitBusinessUi/tag.md +86 -0
- package/docs/pitBusinessUi/textarea.md +65 -0
- package/docs/pitBusinessUi/transfer-direct.md +57 -0
- package/docs/pitBusinessUi/transfer-user-project.md +78 -0
- package/docs/pitBusinessUi/transfer.md +68 -0
- package/docs/pitBusinessUi/tree-lazy.md +72 -0
- package/docs/pitBusinessUi/tree-select-name.md +59 -0
- package/docs/pitBusinessUi/tree-select-plus.md +106 -0
- package/docs/pitBusinessUi/tree-select.md +86 -0
- package/docs/pitBusinessUi/upload-avatar.md +60 -0
- package/docs/pitBusinessUi/upload-file-dialog.md +86 -0
- package/docs/pitBusinessUi/upload-file.md +77 -0
- package/docs/pitBusinessUi/upload-list-card.md +62 -0
- package/docs/pitBusinessUi/upload-table.md +77 -0
- package/docs/pitBusinessUi/user-transform.md +72 -0
- package/docs/pitBusinessUi/utils.md +272 -0
- package/docs/pitBusinessUtils/README.md +144 -0
- package/docs/pitBusinessUtils/auth.md +170 -0
- package/docs/pitBusinessUtils/clipboard.md +72 -0
- package/docs/pitBusinessUtils/filePreview.md +60 -0
- package/docs/pitBusinessUtils/formValidate.md +75 -0
- package/docs/pitBusinessUtils/generateTitle.md +49 -0
- package/docs/pitBusinessUtils/get-page-title.md +65 -0
- package/docs/pitBusinessUtils/i18n.md +130 -0
- package/docs/pitBusinessUtils/jwks.md +82 -0
- package/docs/pitBusinessUtils/oss.md +391 -0
- package/docs/pitBusinessUtils/passwordValidate.md +120 -0
- package/docs/pitBusinessUtils/pit.md +496 -0
- package/docs/pitBusinessUtils/print.md +126 -0
- package/docs/pitBusinessUtils/request.md +137 -0
- package/docs/pitBusinessUtils/scroll-to.md +68 -0
- package/docs/pitBusinessUtils/utils.md +762 -0
- package/docs/pitBusinessUtils/validate.md +224 -0
- package/docs/pitElementUi/alert.md +238 -0
- package/docs/pitElementUi/avatar.md +147 -0
- package/docs/pitElementUi/backtop.md +60 -0
- package/docs/pitElementUi/badge.md +120 -0
- package/docs/pitElementUi/base-tabs.md +73 -0
- package/docs/pitElementUi/border.md +135 -0
- package/docs/pitElementUi/breadcrumb.md +44 -0
- package/docs/pitElementUi/button.md +301 -0
- package/docs/pitElementUi/calendar.md +66 -0
- package/docs/pitElementUi/card.md +170 -0
- package/docs/pitElementUi/carousel.md +212 -0
- package/docs/pitElementUi/cascader.md +1966 -0
- package/docs/pitElementUi/checkbox.md +283 -0
- package/docs/pitElementUi/collapse.md +131 -0
- package/docs/pitElementUi/color-picker.md +123 -0
- package/docs/pitElementUi/color.md +244 -0
- package/docs/pitElementUi/container.md +240 -0
- package/docs/pitElementUi/custom-theme.md +131 -0
- package/docs/pitElementUi/date-picker.md +448 -0
- package/docs/pitElementUi/datetime-picker.md +254 -0
- package/docs/pitElementUi/descriptions.md +191 -0
- package/docs/pitElementUi/dialog-header.md +53 -0
- package/docs/pitElementUi/dialog.md +239 -0
- package/docs/pitElementUi/divider.md +61 -0
- package/docs/pitElementUi/drawer.md +307 -0
- package/docs/pitElementUi/dropdown.md +308 -0
- package/docs/pitElementUi/empty.md +61 -0
- package/docs/pitElementUi/font-family.md +90 -0
- package/docs/pitElementUi/form-base.md +1239 -0
- package/docs/pitElementUi/form-item-checkbox-group.md +48 -0
- package/docs/pitElementUi/form-item-date.md +60 -0
- package/docs/pitElementUi/form-item-dic.md +18 -0
- package/docs/pitElementUi/form-item-editor.md +16 -0
- package/docs/pitElementUi/form-item-input-money.md +19 -0
- package/docs/pitElementUi/form-item-input-number.md +20 -0
- package/docs/pitElementUi/form-item-input.md +18 -0
- package/docs/pitElementUi/form-item-radio-group.md +21 -0
- package/docs/pitElementUi/form-item-select.md +21 -0
- package/docs/pitElementUi/form-item-switch.md +15 -0
- package/docs/pitElementUi/form-item-textarea.md +20 -0
- package/docs/pitElementUi/form-item-tree-select.md +27 -0
- package/docs/pitElementUi/form-item-upload-card.md +18 -0
- package/docs/pitElementUi/form-item-upload.md +1 -0
- package/docs/pitElementUi/form-two.md +102 -0
- package/docs/pitElementUi/form.md +952 -0
- package/docs/pitElementUi/i18n.md +228 -0
- package/docs/pitElementUi/icon-custom.md +99 -0
- package/docs/pitElementUi/icon-line-custom.md +12 -0
- package/docs/pitElementUi/icon.md +28 -0
- package/docs/pitElementUi/image.md +178 -0
- package/docs/pitElementUi/infiniteScroll.md +87 -0
- package/docs/pitElementUi/input-number.md +197 -0
- package/docs/pitElementUi/input-select.md +1 -0
- package/docs/pitElementUi/input.md +800 -0
- package/docs/pitElementUi/installation.md +9 -0
- package/docs/pitElementUi/layout-column.md +376 -0
- package/docs/pitElementUi/layout-tree.md +715 -0
- package/docs/pitElementUi/layout.md +354 -0
- package/docs/pitElementUi/link.md +66 -0
- package/docs/pitElementUi/loading.md +208 -0
- package/docs/pitElementUi/menu.md +403 -0
- package/docs/pitElementUi/message-box.md +326 -0
- package/docs/pitElementUi/message.md +219 -0
- package/docs/pitElementUi/notification.md +311 -0
- package/docs/pitElementUi/page-header.md +40 -0
- package/docs/pitElementUi/pagination.md +200 -0
- package/docs/pitElementUi/popconfirm.md +60 -0
- package/docs/pitElementUi/popover.md +167 -0
- package/docs/pitElementUi/progress.md +178 -0
- package/docs/pitElementUi/quickstart.md +290 -0
- package/docs/pitElementUi/radio.md +211 -0
- package/docs/pitElementUi/rate.md +135 -0
- package/docs/pitElementUi/result.md +76 -0
- package/docs/pitElementUi/select-tree.md +661 -0
- package/docs/pitElementUi/select.md +586 -0
- package/docs/pitElementUi/skeleton.md +316 -0
- package/docs/pitElementUi/slider.md +237 -0
- package/docs/pitElementUi/steps.md +154 -0
- package/docs/pitElementUi/switch.md +142 -0
- package/docs/pitElementUi/table.md +4023 -0
- package/docs/pitElementUi/tabs.md +303 -0
- package/docs/pitElementUi/tag.md +203 -0
- package/docs/pitElementUi/time-picker.md +199 -0
- package/docs/pitElementUi/timeline.md +154 -0
- package/docs/pitElementUi/tooltip.md +177 -0
- package/docs/pitElementUi/transfer.md +249 -0
- package/docs/pitElementUi/transition.md +155 -0
- package/docs/pitElementUi/tree.md +1157 -0
- package/docs/pitElementUi/typography.md +151 -0
- package/docs/pitElementUi/upload-table.md +39 -0
- package/docs/pitElementUi/upload.md +392 -0
- package/docs/pitElementUi/virtual-list.md +154 -0
- package/docs/pitElementUi/virtual-select-tree.md +243 -0
- package/docs/pitElementUi/virtual-select.md +451 -0
- package/docs/pitElementUi/virtual-table-column.md +1 -0
- package/docs/pitElementUi/virtual-table.md +490 -0
- package/docs/pitElementUi/virtual-tree.md +119 -0
- package/package.json +33 -0
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import bus from '../../bus';
|
|
3
|
+
import { tintColor } from '../../color.js';
|
|
4
|
+
import { ACTION_USER_CONFIG_UPDATE } from '../../components/theme/constant.js';
|
|
5
|
+
const varMap = {
|
|
6
|
+
'primary': '$--color-primary',
|
|
7
|
+
'success': '$--color-success',
|
|
8
|
+
'warning': '$--color-warning',
|
|
9
|
+
'danger': '$--color-danger',
|
|
10
|
+
'info': '$--color-info',
|
|
11
|
+
'white': '$--color-white',
|
|
12
|
+
'black': '$--color-black',
|
|
13
|
+
'textPrimary': '$--color-text-primary',
|
|
14
|
+
'textRegular': '$--color-text-regular',
|
|
15
|
+
'textSecondary': '$--color-text-secondary',
|
|
16
|
+
'textPlaceholder': '$--color-text-placeholder',
|
|
17
|
+
'borderBase': '$--border-color-base',
|
|
18
|
+
'borderLight': '$--border-color-light',
|
|
19
|
+
'borderLighter': '$--border-color-lighter',
|
|
20
|
+
'borderExtraLight': '$--border-color-extra-light'
|
|
21
|
+
};
|
|
22
|
+
const original = {
|
|
23
|
+
primary: '#409EFF',
|
|
24
|
+
success: '#67C23A',
|
|
25
|
+
warning: '#E6A23C',
|
|
26
|
+
danger: '#F56C6C',
|
|
27
|
+
info: '#909399',
|
|
28
|
+
white: '#FFFFFF',
|
|
29
|
+
black: '#000000',
|
|
30
|
+
textPrimary: '#303133',
|
|
31
|
+
textRegular: '#606266',
|
|
32
|
+
textSecondary: '#909399',
|
|
33
|
+
textPlaceholder: '#C0C4CC',
|
|
34
|
+
borderBase: '#DCDFE6',
|
|
35
|
+
borderLight: '#E4E7ED',
|
|
36
|
+
borderLighter: '#EBEEF5',
|
|
37
|
+
borderExtraLight: '#F2F6FC'
|
|
38
|
+
}
|
|
39
|
+
export default {
|
|
40
|
+
created() {
|
|
41
|
+
bus.$on(ACTION_USER_CONFIG_UPDATE, this.setGlobal);
|
|
42
|
+
},
|
|
43
|
+
mounted() {
|
|
44
|
+
this.setGlobal();
|
|
45
|
+
},
|
|
46
|
+
methods: {
|
|
47
|
+
tintColor(color, tint) {
|
|
48
|
+
return tintColor(color, tint);
|
|
49
|
+
},
|
|
50
|
+
setGlobal() {
|
|
51
|
+
if (window.userThemeConfig) {
|
|
52
|
+
this.global = window.userThemeConfig.global;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
data() {
|
|
57
|
+
return {
|
|
58
|
+
global: {},
|
|
59
|
+
primary: '',
|
|
60
|
+
success: '',
|
|
61
|
+
warning: '',
|
|
62
|
+
danger: '',
|
|
63
|
+
info: '',
|
|
64
|
+
white: '',
|
|
65
|
+
black: '',
|
|
66
|
+
textPrimary: '',
|
|
67
|
+
textRegular: '',
|
|
68
|
+
textSecondary: '',
|
|
69
|
+
textPlaceholder: '',
|
|
70
|
+
borderBase: '',
|
|
71
|
+
borderLight: '',
|
|
72
|
+
borderLighter: '',
|
|
73
|
+
borderExtraLight: ''
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
watch: {
|
|
77
|
+
global: {
|
|
78
|
+
immediate: true,
|
|
79
|
+
handler(value) {
|
|
80
|
+
Object.keys(original).forEach((o) => {
|
|
81
|
+
if (value[varMap[o]]) {
|
|
82
|
+
this[o] = value[varMap[o]]
|
|
83
|
+
} else {
|
|
84
|
+
this[o] = original[o]
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
}
|
|
91
|
+
</script>
|
|
92
|
+
|
|
93
|
+
## Color 色彩
|
|
94
|
+
|
|
95
|
+
Element 为了避免视觉传达差异,使用一套特定的调色板来规定颜色,为你所搭建的产品提供一致的外观视觉感受。
|
|
96
|
+
|
|
97
|
+
### 主色
|
|
98
|
+
|
|
99
|
+
Element 主要品牌颜色是鲜艳、友好的蓝色。
|
|
100
|
+
|
|
101
|
+
<el-row :gutter="12">
|
|
102
|
+
<el-col :span="10" :xs="{span: 12}">
|
|
103
|
+
<div class="demo-color-box" :style="{ background: primary }">Brand Color
|
|
104
|
+
<div class="value">#409EFF</div>
|
|
105
|
+
<div class="bg-color-sub" :style="{ background: tintColor(primary, 0.9) }">
|
|
106
|
+
<div
|
|
107
|
+
class="bg-blue-sub-item"
|
|
108
|
+
v-for="(item, key) in Array(8)"
|
|
109
|
+
:key="key"
|
|
110
|
+
:style="{ background: tintColor(primary, (key + 1) / 10) }"
|
|
111
|
+
></div>
|
|
112
|
+
</div>
|
|
113
|
+
</div>
|
|
114
|
+
</el-col>
|
|
115
|
+
</el-row>
|
|
116
|
+
|
|
117
|
+
### 辅助色
|
|
118
|
+
|
|
119
|
+
除了主色外的场景色,需要在不同的场景中使用(例如危险色表示危险的操作)。
|
|
120
|
+
|
|
121
|
+
<el-row :gutter="12">
|
|
122
|
+
<el-col :span="6" :xs="{span: 12}">
|
|
123
|
+
<div class="demo-color-box"
|
|
124
|
+
:style="{ background: success }"
|
|
125
|
+
>Success<div class="value">#67C23A</div>
|
|
126
|
+
<div
|
|
127
|
+
class="bg-color-sub"
|
|
128
|
+
>
|
|
129
|
+
<div
|
|
130
|
+
class="bg-success-sub-item"
|
|
131
|
+
v-for="(item, key) in Array(2)"
|
|
132
|
+
:key="key"
|
|
133
|
+
:style="{ background: tintColor(success, (key + 8) / 10) }"
|
|
134
|
+
>
|
|
135
|
+
</div>
|
|
136
|
+
</div>
|
|
137
|
+
</div>
|
|
138
|
+
</el-col>
|
|
139
|
+
<el-col :span="6" :xs="{span: 12}">
|
|
140
|
+
<div class="demo-color-box"
|
|
141
|
+
:style="{ background: warning }"
|
|
142
|
+
>Warning<div class="value">#E6A23C</div>
|
|
143
|
+
<div
|
|
144
|
+
class="bg-color-sub"
|
|
145
|
+
>
|
|
146
|
+
<div
|
|
147
|
+
class="bg-success-sub-item"
|
|
148
|
+
v-for="(item, key) in Array(2)"
|
|
149
|
+
:key="key"
|
|
150
|
+
:style="{ background: tintColor(warning, (key + 8) / 10) }"
|
|
151
|
+
>
|
|
152
|
+
</div>
|
|
153
|
+
</div>
|
|
154
|
+
</div>
|
|
155
|
+
</el-col>
|
|
156
|
+
<el-col :span="6" :xs="{span: 12}">
|
|
157
|
+
<div class="demo-color-box"
|
|
158
|
+
:style="{ background: danger }"
|
|
159
|
+
>Danger<div class="value">#F56C6C</div>
|
|
160
|
+
<div
|
|
161
|
+
class="bg-color-sub"
|
|
162
|
+
>
|
|
163
|
+
<div
|
|
164
|
+
class="bg-success-sub-item"
|
|
165
|
+
v-for="(item, key) in Array(2)"
|
|
166
|
+
:key="key"
|
|
167
|
+
:style="{ background: tintColor(danger, (key + 8) / 10) }"
|
|
168
|
+
>
|
|
169
|
+
</div>
|
|
170
|
+
</div>
|
|
171
|
+
</div>
|
|
172
|
+
</el-col>
|
|
173
|
+
<el-col :span="6" :xs="{span: 12}">
|
|
174
|
+
<div class="demo-color-box"
|
|
175
|
+
:style="{ background: info }"
|
|
176
|
+
>Info<div class="value">#909399</div>
|
|
177
|
+
<div
|
|
178
|
+
class="bg-color-sub"
|
|
179
|
+
>
|
|
180
|
+
<div
|
|
181
|
+
class="bg-success-sub-item"
|
|
182
|
+
v-for="(item, key) in Array(2)"
|
|
183
|
+
:key="key"
|
|
184
|
+
:style="{ background: tintColor(info, (key + 8) / 10) }"
|
|
185
|
+
>
|
|
186
|
+
</div>
|
|
187
|
+
</div>
|
|
188
|
+
</div>
|
|
189
|
+
</el-col>
|
|
190
|
+
</el-row>
|
|
191
|
+
|
|
192
|
+
### 中性色
|
|
193
|
+
|
|
194
|
+
中性色用于文本、背景和边框颜色。通过运用不同的中性色,来表现层次结构。
|
|
195
|
+
|
|
196
|
+
<el-row :gutter="12">
|
|
197
|
+
<el-col :span="6" :xs="{span: 12}">
|
|
198
|
+
<div class="demo-color-box-group">
|
|
199
|
+
<div class="demo-color-box demo-color-box-other"
|
|
200
|
+
:style="{ background: textPrimary }"
|
|
201
|
+
>主要文字<div class="value">{{textPrimary}}</div></div>
|
|
202
|
+
<div class="demo-color-box demo-color-box-other"
|
|
203
|
+
:style="{ background: textRegular }"
|
|
204
|
+
>
|
|
205
|
+
常规文字<div class="value">{{textRegular}}</div></div>
|
|
206
|
+
<div class="demo-color-box demo-color-box-other"
|
|
207
|
+
:style="{ background: textSecondary }"
|
|
208
|
+
>次要文字<div class="value">{{textSecondary}}</div></div>
|
|
209
|
+
<div class="demo-color-box demo-color-box-other"
|
|
210
|
+
:style="{ background: textPlaceholder }"
|
|
211
|
+
>占位文字<div class="value">{{textPlaceholder}}</div></div>
|
|
212
|
+
</div>
|
|
213
|
+
</el-col>
|
|
214
|
+
<el-col :span="6" :xs="{span: 12}">
|
|
215
|
+
<div class="demo-color-box-group">
|
|
216
|
+
<div class="demo-color-box demo-color-box-other demo-color-box-lite"
|
|
217
|
+
:style="{ background: borderBase }"
|
|
218
|
+
>一级边框<div class="value">{{borderBase}}</div></div>
|
|
219
|
+
<div class="demo-color-box demo-color-box-other demo-color-box-lite"
|
|
220
|
+
:style="{ background: borderLight }"
|
|
221
|
+
>二级边框<div class="value">{{borderLight}}</div></div>
|
|
222
|
+
<div class="demo-color-box demo-color-box-other demo-color-box-lite"
|
|
223
|
+
:style="{ background: borderLighter }"
|
|
224
|
+
>三级边框<div class="value">{{borderLighter}}</div></div>
|
|
225
|
+
<div class="demo-color-box demo-color-box-other demo-color-box-lite"
|
|
226
|
+
:style="{ background: borderExtraLight }"
|
|
227
|
+
>四级边框<div class="value">{{borderExtraLight}}</div></div>
|
|
228
|
+
</div>
|
|
229
|
+
</el-col>
|
|
230
|
+
<el-col :span="6" :xs="{span: 12}">
|
|
231
|
+
<div class="demo-color-box-group">
|
|
232
|
+
<div
|
|
233
|
+
class="demo-color-box demo-color-box-other"
|
|
234
|
+
:style="{ background: black }"
|
|
235
|
+
>基础黑色<div class="value">{{black}}</div></div>
|
|
236
|
+
<div
|
|
237
|
+
class="demo-color-box demo-color-box-other"
|
|
238
|
+
:style="{ background: white, color: '#303133', border: '1px solid #eee' }"
|
|
239
|
+
>基础白色<div class="value">{{white}}</div></div>
|
|
240
|
+
<div class="demo-color-box demo-color-box-other bg-transparent">透明<div class="value">Transparent</div>
|
|
241
|
+
</div>
|
|
242
|
+
</div>
|
|
243
|
+
</el-col>
|
|
244
|
+
</el-row>
|
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
## Container 布局容器
|
|
2
|
+
用于布局的容器组件,方便快速搭建页面的基本结构:
|
|
3
|
+
|
|
4
|
+
`<el-container>`:外层容器。当子元素中包含 `<el-header>` 或 `<el-footer>` 时,全部子元素会垂直上下排列,否则会水平左右排列。
|
|
5
|
+
|
|
6
|
+
`<el-header>`:顶栏容器。
|
|
7
|
+
|
|
8
|
+
`<el-aside>`:侧边栏容器。
|
|
9
|
+
|
|
10
|
+
`<el-main>`:主要区域容器。
|
|
11
|
+
|
|
12
|
+
`<el-footer>`:底栏容器。
|
|
13
|
+
|
|
14
|
+
:::tip
|
|
15
|
+
以上组件采用了 flex 布局,使用前请确定目标浏览器是否兼容。此外,`<el-container>` 的子元素只能是后四者,后四者的父元素也只能是 `<el-container>`。
|
|
16
|
+
:::
|
|
17
|
+
|
|
18
|
+
### 常见页面布局
|
|
19
|
+
|
|
20
|
+
:::demo
|
|
21
|
+
```html
|
|
22
|
+
<el-container>
|
|
23
|
+
<el-header>Header</el-header>
|
|
24
|
+
<el-main>Main</el-main>
|
|
25
|
+
</el-container>
|
|
26
|
+
|
|
27
|
+
<el-container>
|
|
28
|
+
<el-header>Header</el-header>
|
|
29
|
+
<el-main>Main</el-main>
|
|
30
|
+
<el-footer>Footer</el-footer>
|
|
31
|
+
</el-container>
|
|
32
|
+
|
|
33
|
+
<el-container>
|
|
34
|
+
<el-aside width="200px">Aside</el-aside>
|
|
35
|
+
<el-main>Main</el-main>
|
|
36
|
+
</el-container>
|
|
37
|
+
|
|
38
|
+
<el-container>
|
|
39
|
+
<el-header>Header</el-header>
|
|
40
|
+
<el-container>
|
|
41
|
+
<el-aside width="200px">Aside</el-aside>
|
|
42
|
+
<el-main>Main</el-main>
|
|
43
|
+
</el-container>
|
|
44
|
+
</el-container>
|
|
45
|
+
|
|
46
|
+
<el-container>
|
|
47
|
+
<el-header>Header</el-header>
|
|
48
|
+
<el-container>
|
|
49
|
+
<el-aside width="200px">Aside</el-aside>
|
|
50
|
+
<el-container>
|
|
51
|
+
<el-main>Main</el-main>
|
|
52
|
+
<el-footer>Footer</el-footer>
|
|
53
|
+
</el-container>
|
|
54
|
+
</el-container>
|
|
55
|
+
</el-container>
|
|
56
|
+
|
|
57
|
+
<el-container>
|
|
58
|
+
<el-aside width="200px">Aside</el-aside>
|
|
59
|
+
<el-container>
|
|
60
|
+
<el-header>Header</el-header>
|
|
61
|
+
<el-main>Main</el-main>
|
|
62
|
+
</el-container>
|
|
63
|
+
</el-container>
|
|
64
|
+
|
|
65
|
+
<el-container>
|
|
66
|
+
<el-aside width="200px">Aside</el-aside>
|
|
67
|
+
<el-container>
|
|
68
|
+
<el-header>Header</el-header>
|
|
69
|
+
<el-main>Main</el-main>
|
|
70
|
+
<el-footer>Footer</el-footer>
|
|
71
|
+
</el-container>
|
|
72
|
+
</el-container>
|
|
73
|
+
|
|
74
|
+
<style>
|
|
75
|
+
.el-header, .el-footer {
|
|
76
|
+
background-color: #B3C0D1;
|
|
77
|
+
color: #333;
|
|
78
|
+
text-align: center;
|
|
79
|
+
line-height: 60px;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.el-aside {
|
|
83
|
+
background-color: #D3DCE6;
|
|
84
|
+
color: #333;
|
|
85
|
+
text-align: center;
|
|
86
|
+
line-height: 200px;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.el-main {
|
|
90
|
+
background-color: #E9EEF3;
|
|
91
|
+
color: #333;
|
|
92
|
+
text-align: center;
|
|
93
|
+
line-height: 160px;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
body > .el-container {
|
|
97
|
+
margin-bottom: 40px;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.el-container:nth-child(5) .el-aside,
|
|
101
|
+
.el-container:nth-child(6) .el-aside {
|
|
102
|
+
line-height: 260px;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.el-container:nth-child(7) .el-aside {
|
|
106
|
+
line-height: 320px;
|
|
107
|
+
}
|
|
108
|
+
</style>
|
|
109
|
+
```
|
|
110
|
+
:::
|
|
111
|
+
|
|
112
|
+
### 实例
|
|
113
|
+
|
|
114
|
+
:::demo
|
|
115
|
+
```html
|
|
116
|
+
<el-container style="height: 500px; border: 1px solid #eee">
|
|
117
|
+
<el-aside width="200px" style="background-color: rgb(238, 241, 246)">
|
|
118
|
+
<el-menu :default-openeds="['1', '3']">
|
|
119
|
+
<el-submenu index="1">
|
|
120
|
+
<template slot="title"><i class="el-icon-message"></i>导航一</template>
|
|
121
|
+
<el-menu-item-group>
|
|
122
|
+
<template slot="title">分组一</template>
|
|
123
|
+
<el-menu-item index="1-1">选项1</el-menu-item>
|
|
124
|
+
<el-menu-item index="1-2">选项2</el-menu-item>
|
|
125
|
+
</el-menu-item-group>
|
|
126
|
+
<el-menu-item-group title="分组2">
|
|
127
|
+
<el-menu-item index="1-3">选项3</el-menu-item>
|
|
128
|
+
</el-menu-item-group>
|
|
129
|
+
<el-submenu index="1-4">
|
|
130
|
+
<template slot="title">选项4</template>
|
|
131
|
+
<el-menu-item index="1-4-1">选项4-1</el-menu-item>
|
|
132
|
+
</el-submenu>
|
|
133
|
+
</el-submenu>
|
|
134
|
+
<el-submenu index="2">
|
|
135
|
+
<template slot="title"><i class="el-icon-menu"></i>导航二</template>
|
|
136
|
+
<el-menu-item-group>
|
|
137
|
+
<template slot="title">分组一</template>
|
|
138
|
+
<el-menu-item index="2-1">选项1</el-menu-item>
|
|
139
|
+
<el-menu-item index="2-2">选项2</el-menu-item>
|
|
140
|
+
</el-menu-item-group>
|
|
141
|
+
<el-menu-item-group title="分组2">
|
|
142
|
+
<el-menu-item index="2-3">选项3</el-menu-item>
|
|
143
|
+
</el-menu-item-group>
|
|
144
|
+
<el-submenu index="2-4">
|
|
145
|
+
<template slot="title">选项4</template>
|
|
146
|
+
<el-menu-item index="2-4-1">选项4-1</el-menu-item>
|
|
147
|
+
</el-submenu>
|
|
148
|
+
</el-submenu>
|
|
149
|
+
<el-submenu index="3">
|
|
150
|
+
<template slot="title"><i class="el-icon-setting"></i>导航三</template>
|
|
151
|
+
<el-menu-item-group>
|
|
152
|
+
<template slot="title">分组一</template>
|
|
153
|
+
<el-menu-item index="3-1">选项1</el-menu-item>
|
|
154
|
+
<el-menu-item index="3-2">选项2</el-menu-item>
|
|
155
|
+
</el-menu-item-group>
|
|
156
|
+
<el-menu-item-group title="分组2">
|
|
157
|
+
<el-menu-item index="3-3">选项3</el-menu-item>
|
|
158
|
+
</el-menu-item-group>
|
|
159
|
+
<el-submenu index="3-4">
|
|
160
|
+
<template slot="title">选项4</template>
|
|
161
|
+
<el-menu-item index="3-4-1">选项4-1</el-menu-item>
|
|
162
|
+
</el-submenu>
|
|
163
|
+
</el-submenu>
|
|
164
|
+
</el-menu>
|
|
165
|
+
</el-aside>
|
|
166
|
+
|
|
167
|
+
<el-container>
|
|
168
|
+
<el-header style="text-align: right; font-size: 12px">
|
|
169
|
+
<el-dropdown>
|
|
170
|
+
<i class="el-icon-setting" style="margin-right: 15px"></i>
|
|
171
|
+
<el-dropdown-menu slot="dropdown">
|
|
172
|
+
<el-dropdown-item>查看</el-dropdown-item>
|
|
173
|
+
<el-dropdown-item>新增</el-dropdown-item>
|
|
174
|
+
<el-dropdown-item>删除</el-dropdown-item>
|
|
175
|
+
</el-dropdown-menu>
|
|
176
|
+
</el-dropdown>
|
|
177
|
+
<span>王小虎</span>
|
|
178
|
+
</el-header>
|
|
179
|
+
|
|
180
|
+
<el-main>
|
|
181
|
+
<el-table :data="tableData">
|
|
182
|
+
<el-table-column prop="date" label="日期" width="140">
|
|
183
|
+
</el-table-column>
|
|
184
|
+
<el-table-column prop="name" label="姓名" width="120">
|
|
185
|
+
</el-table-column>
|
|
186
|
+
<el-table-column prop="address" label="地址">
|
|
187
|
+
</el-table-column>
|
|
188
|
+
</el-table>
|
|
189
|
+
</el-main>
|
|
190
|
+
</el-container>
|
|
191
|
+
</el-container>
|
|
192
|
+
|
|
193
|
+
<style>
|
|
194
|
+
.el-header {
|
|
195
|
+
background-color: #B3C0D1;
|
|
196
|
+
color: #333;
|
|
197
|
+
line-height: 60px;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
.el-aside {
|
|
201
|
+
color: #333;
|
|
202
|
+
}
|
|
203
|
+
</style>
|
|
204
|
+
|
|
205
|
+
<script>
|
|
206
|
+
export default {
|
|
207
|
+
data() {
|
|
208
|
+
const item = {
|
|
209
|
+
date: '2016-05-02',
|
|
210
|
+
name: '王小虎',
|
|
211
|
+
address: '上海市普陀区金沙江路 1518 弄'
|
|
212
|
+
};
|
|
213
|
+
return {
|
|
214
|
+
tableData: Array(20).fill(item)
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
};
|
|
218
|
+
</script>
|
|
219
|
+
```
|
|
220
|
+
:::
|
|
221
|
+
|
|
222
|
+
### Container Attributes
|
|
223
|
+
| 参数 | 说明 | 类型 | 可选值 | 默认值 |
|
|
224
|
+
|---------|----------|---------|-------------|--------|
|
|
225
|
+
| direction | 子元素的排列方向 | string | horizontal / vertical | 子元素中有 `el-header` 或 `el-footer` 时为 vertical,否则为 horizontal |
|
|
226
|
+
|
|
227
|
+
### Header Attributes
|
|
228
|
+
| 参数 | 说明 | 类型 | 可选值 | 默认值 |
|
|
229
|
+
|---------|----------|---------|-------------|--------|
|
|
230
|
+
| height | 顶栏高度 | string | — | 60px |
|
|
231
|
+
|
|
232
|
+
### Aside Attributes
|
|
233
|
+
| 参数 | 说明 | 类型 | 可选值 | 默认值 |
|
|
234
|
+
|---------|----------|---------|-------------|--------|
|
|
235
|
+
| width | 侧边栏宽度 | string | — | 300px |
|
|
236
|
+
|
|
237
|
+
### Footer Attributes
|
|
238
|
+
| 参数 | 说明 | 类型 | 可选值 | 默认值 |
|
|
239
|
+
|---------|----------|---------|-------------|--------|
|
|
240
|
+
| height | 底栏高度 | string | — | 60px |
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
## 自定义主题
|
|
2
|
+
Element 默认提供一套主题,CSS 命名采用 BEM 的风格,方便使用者覆盖样式。我们提供了四种方法,可以进行不同程度的样式自定义。
|
|
3
|
+
|
|
4
|
+
### 主题编辑器
|
|
5
|
+
使用[在线主题编辑器](./#/zh-CN/theme),可以修改定制 Element 所有全局和组件的 Design Tokens,并可以方便地实时预览样式改变后的视觉。同时它还可以基于新的定制样式生成完整的样式文件包,供直接下载使用(关于如何使用下载的主题包,请参考本节「引入自定义主题」部分)。
|
|
6
|
+
|
|
7
|
+
也可以使用[主题编辑器 Chrome 插件](https://chrome.google.com/webstore/detail/element-theme-roller/lifkjlojflekabbmlddfccdkphlelmim),在任何使用 Element 开发的网站上配置并实时预览主题。
|
|
8
|
+
|
|
9
|
+
<img src="https://shadow.elemecdn.com/app/sns-client/element-theme-editor2.e16c6a01-806d-11e9-bc23-21435c54c509.png" style="width: 100%;margin: 30px auto 0;display: block;">
|
|
10
|
+
|
|
11
|
+
### 仅替换主题色
|
|
12
|
+
如果仅希望更换 Element 的主题色,推荐使用[在线主题生成工具](https://elementui.github.io/theme-chalk-preview)。Element 默认的主题色是鲜艳、友好的蓝色。通过替换主题色,能够让 Element 的视觉更加符合具体项目的定位。
|
|
13
|
+
|
|
14
|
+
使用上述工具,可以很方便地实时预览主题色改变之后的视觉,同时它还可以基于新的主题色生成完整的样式文件包,供直接下载使用(关于如何使用下载的主题包,请参考本节「引入自定义主题」和「搭配插件按需引入组件主题」部分)。
|
|
15
|
+
|
|
16
|
+
### 在项目中改变 SCSS 变量
|
|
17
|
+
Element 的 theme-chalk 使用 SCSS 编写,如果你的项目也使用了 SCSS,那么可以直接在项目中改变 Element 的样式变量。新建一个样式文件,例如 `element-variables.scss`,写入以下内容:
|
|
18
|
+
```html
|
|
19
|
+
/* 改变主题色变量 */
|
|
20
|
+
$--color-primary: teal;
|
|
21
|
+
|
|
22
|
+
/* 改变 icon 字体路径变量,必需 */
|
|
23
|
+
$--font-path: '~element-ui/lib/theme-chalk/fonts';
|
|
24
|
+
|
|
25
|
+
@import "~element-ui/packages/theme-chalk/src/index";
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
之后,在项目的入口文件中,直接引入以上样式文件即可(无需引入 Element 编译好的 CSS 文件):
|
|
29
|
+
```JS
|
|
30
|
+
import Vue from 'vue'
|
|
31
|
+
import Element from 'element-ui'
|
|
32
|
+
import './element-variables.scss'
|
|
33
|
+
|
|
34
|
+
Vue.use(Element)
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
:::tip
|
|
38
|
+
需要注意的是,覆盖字体路径变量是必需的,将其赋值为 Element 中 icon 图标所在的相对路径即可。
|
|
39
|
+
:::
|
|
40
|
+
|
|
41
|
+
### 命令行主题工具
|
|
42
|
+
如果你的项目没有使用 SCSS,那么可以使用命令行主题工具进行深层次的主题定制:
|
|
43
|
+
|
|
44
|
+
#### <strong>安装工具</strong>
|
|
45
|
+
首先安装「主题生成工具」,可以全局安装或者安装在当前项目下,推荐安装在项目里,方便别人 clone 项目时能直接安装依赖并启动,这里以全局安装做演示。
|
|
46
|
+
```shell
|
|
47
|
+
npm i element-theme -g
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
安装白垩主题,可以从 npm 安装或者从 GitHub 拉取最新代码。
|
|
51
|
+
```shell
|
|
52
|
+
# 从 npm
|
|
53
|
+
npm i element-theme-chalk -D
|
|
54
|
+
|
|
55
|
+
# 从 GitHub
|
|
56
|
+
npm i https://github.com/ElementUI/theme-chalk -D
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
#### <strong>初始化变量文件</strong>
|
|
60
|
+
主题生成工具安装成功后,如果全局安装可以在命令行里通过 `et` 调用工具,如果安装在当前目录下,需要通过 `node_modules/.bin/et` 访问到命令。执行 `-i` 初始化变量文件。默认输出到 `element-variables.scss`,当然你可以传参数指定文件输出目录。
|
|
61
|
+
|
|
62
|
+
```shell
|
|
63
|
+
et -i [可以自定义变量文件]
|
|
64
|
+
|
|
65
|
+
> ✔ Generator variables file
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
如果使用默认配置,执行后当前目录会有一个 `element-variables.scss` 文件。内部包含了主题所用到的所有变量,它们使用 SCSS 的格式定义。大致结构如下:
|
|
69
|
+
```css
|
|
70
|
+
$--color-primary: #409EFF !default;
|
|
71
|
+
$--color-primary-light-1: mix($--color-white, $--color-primary, 10%) !default; /* 53a8ff */
|
|
72
|
+
$--color-primary-light-2: mix($--color-white, $--color-primary, 20%) !default; /* 66b1ff */
|
|
73
|
+
$--color-primary-light-3: mix($--color-white, $--color-primary, 30%) !default; /* 79bbff */
|
|
74
|
+
$--color-primary-light-4: mix($--color-white, $--color-primary, 40%) !default; /* 8cc5ff */
|
|
75
|
+
$--color-primary-light-5: mix($--color-white, $--color-primary, 50%) !default; /* a0cfff */
|
|
76
|
+
$--color-primary-light-6: mix($--color-white, $--color-primary, 60%) !default; /* b3d8ff */
|
|
77
|
+
$--color-primary-light-7: mix($--color-white, $--color-primary, 70%) !default; /* c6e2ff */
|
|
78
|
+
$--color-primary-light-8: mix($--color-white, $--color-primary, 80%) !default; /* d9ecff */
|
|
79
|
+
$--color-primary-light-9: mix($--color-white, $--color-primary, 90%) !default; /* ecf5ff */
|
|
80
|
+
|
|
81
|
+
$--color-success: #67c23a !default;
|
|
82
|
+
$--color-warning: #e6a23c !default;
|
|
83
|
+
$--color-danger: #f56c6c !default;
|
|
84
|
+
$--color-info: #909399 !default;
|
|
85
|
+
|
|
86
|
+
...
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
#### <strong>修改变量</strong>
|
|
90
|
+
直接编辑 `element-variables.scss` 文件,例如修改主题色为红色。
|
|
91
|
+
```CSS
|
|
92
|
+
$--color-primary: red;
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
#### <strong>编译主题</strong>
|
|
96
|
+
保存文件后,到命令行里执行 `et` 编译主题,如果你想启用 `watch` 模式,实时编译主题,增加 `-w` 参数;如果你在初始化时指定了自定义变量文件,则需要增加 `-c` 参数,并带上你的变量文件名。默认情况下编译的主题目录是放在 `./theme` 下,你可以通过 `-o` 参数指定打包目录。
|
|
97
|
+
```shell
|
|
98
|
+
et
|
|
99
|
+
|
|
100
|
+
> ✔ build theme font
|
|
101
|
+
> ✔ build element theme
|
|
102
|
+
```
|
|
103
|
+
### 使用自定义主题
|
|
104
|
+
#### <strong>引入自定义主题</strong>
|
|
105
|
+
和引入默认主题一样,在代码里直接引用「在线主题编辑器」或「命令行工具」生成的主题的 `theme/index.css` 文件即可。
|
|
106
|
+
|
|
107
|
+
```javascript
|
|
108
|
+
import '../theme/index.css'
|
|
109
|
+
import ElementUI from 'element-ui'
|
|
110
|
+
import Vue from 'vue'
|
|
111
|
+
|
|
112
|
+
Vue.use(ElementUI)
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
#### <strong>搭配插件按需引入组件主题</strong>
|
|
116
|
+
如果是搭配 `babel-plugin-component` 一起使用,只需要修改 `.babelrc` 的配置,指定 `styleLibraryName` 路径为自定义主题相对于 `.babelrc` 的路径,注意要加 `~`。
|
|
117
|
+
```json
|
|
118
|
+
{
|
|
119
|
+
"plugins": [
|
|
120
|
+
[
|
|
121
|
+
"component",
|
|
122
|
+
{
|
|
123
|
+
"libraryName": "element-ui",
|
|
124
|
+
"styleLibraryName": "~theme"
|
|
125
|
+
}
|
|
126
|
+
]
|
|
127
|
+
]
|
|
128
|
+
}
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
如果不清楚 `babel-plugin-component` 是什么,请阅读 <a href="./#/zh-CN/component/quickstart">快速上手</a> 一节。更多 `element-theme` 用法请参考[项目仓库](https://github.com/ElementUI/element-theme)。
|