xt-element-ui 1.0.0 → 1.0.1
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/docs/.vuepress/config.js +23 -0
- package/docs/.vuepress/enhanceApp.js +8 -0
- package/docs/README.md +6 -0
- package/docs/components/base/button.md +5 -0
- package/docs/components/base/input.md +22 -0
- package/examples/App.vue +13 -0
- package/examples/favicon.ico +0 -0
- package/examples/index.html +11 -0
- package/examples/main.js +9 -0
- package/lib/fonts/element-icons.f1a45d74.ttf +0 -0
- package/lib/fonts/element-icons.ff18efd1.woff +0 -0
- package/lib/index.common.js +124 -23
- package/lib/index.css +1 -0
- package/lib/index.umd.js +170 -30
- package/lib/index.umd.min.js +1 -1
- package/package.json +4 -2
- package/src/components/button/index.js +2 -0
- package/src/components/button/index.vue +14 -0
- package/src/components/input/index.js +2 -0
- package/src/components/input/index.vue +20 -0
- package/src/index.js +45 -5
- package/vue.config.js +14 -9
- package/src/components/Button.vue +0 -1
- package/src/components/Input.vue +0 -1
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
title: '组件文档',
|
|
3
|
+
themeConfig: {
|
|
4
|
+
nav: [
|
|
5
|
+
{ text: '首页', link: '/' },
|
|
6
|
+
{ text: '组件', link: '/components/base/button' }
|
|
7
|
+
],
|
|
8
|
+
sidebarDepth: 2,
|
|
9
|
+
nextLinks: true,
|
|
10
|
+
prevLinks: true,
|
|
11
|
+
// 直接写完整路径,最稳、最简单、不踩坑
|
|
12
|
+
sidebar: [
|
|
13
|
+
{
|
|
14
|
+
title: '基础组件',
|
|
15
|
+
path: '/components/base/button',
|
|
16
|
+
children: [
|
|
17
|
+
['/components/base/button', '按钮'],
|
|
18
|
+
['/components/base/input', '输入框']
|
|
19
|
+
]
|
|
20
|
+
}
|
|
21
|
+
]
|
|
22
|
+
}
|
|
23
|
+
}
|
package/docs/README.md
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Input 输入框
|
|
2
|
+
|
|
3
|
+
基于 el-input 封装的统一输入框
|
|
4
|
+
|
|
5
|
+
## 基础用法
|
|
6
|
+
<xt-input v-model="inputVal" placeholder="请输入内容"></xt-input>
|
|
7
|
+
|
|
8
|
+
<script>
|
|
9
|
+
export default {
|
|
10
|
+
data() {
|
|
11
|
+
return {
|
|
12
|
+
inputVal: ''
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
</script>
|
|
17
|
+
|
|
18
|
+
## 属性
|
|
19
|
+
| 参数 | 说明 | 类型 | 默认值 |
|
|
20
|
+
| --- | --- | --- | --- |
|
|
21
|
+
| v-model | 绑定值 | string / number | - |
|
|
22
|
+
| placeholder | 占位符 | string | '请输入内容' |
|
package/examples/App.vue
ADDED
|
Binary file
|
package/examples/main.js
ADDED
|
Binary file
|
|
Binary file
|
package/lib/index.common.js
CHANGED
|
@@ -4,6 +4,18 @@
|
|
|
4
4
|
/******/ var __webpack_require__ = {};
|
|
5
5
|
/******/
|
|
6
6
|
/************************************************************************/
|
|
7
|
+
/******/ /* webpack/runtime/compat get default export */
|
|
8
|
+
/******/ (() => {
|
|
9
|
+
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
|
10
|
+
/******/ __webpack_require__.n = (module) => {
|
|
11
|
+
/******/ var getter = module && module.__esModule ?
|
|
12
|
+
/******/ () => (module['default']) :
|
|
13
|
+
/******/ () => (module);
|
|
14
|
+
/******/ __webpack_require__.d(getter, { a: getter });
|
|
15
|
+
/******/ return getter;
|
|
16
|
+
/******/ };
|
|
17
|
+
/******/ })();
|
|
18
|
+
/******/
|
|
7
19
|
/******/ /* webpack/runtime/define property getters */
|
|
8
20
|
/******/ (() => {
|
|
9
21
|
/******/ // define getter functions for harmony exports
|
|
@@ -44,7 +56,13 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
44
56
|
|
|
45
57
|
// EXPORTS
|
|
46
58
|
__webpack_require__.d(__webpack_exports__, {
|
|
47
|
-
|
|
59
|
+
ElementUI: () => (/* reexport */ (external_ElementUI_default())),
|
|
60
|
+
Vue: () => (/* reexport */ (external_Vue_default())),
|
|
61
|
+
"default": () => (/* binding */ entry_lib),
|
|
62
|
+
getSize: () => (/* reexport */ getSize),
|
|
63
|
+
getTheme: () => (/* reexport */ getTheme),
|
|
64
|
+
setSize: () => (/* reexport */ setSize),
|
|
65
|
+
setTheme: () => (/* reexport */ setTheme)
|
|
48
66
|
});
|
|
49
67
|
|
|
50
68
|
;// ./node_modules/@vue/cli-service/lib/commands/build/setPublicPath.js
|
|
@@ -65,12 +83,32 @@ if (typeof window !== 'undefined') {
|
|
|
65
83
|
// Indicate to webpack that this file can be concatenated
|
|
66
84
|
/* harmony default export */ const setPublicPath = (null);
|
|
67
85
|
|
|
68
|
-
;//
|
|
69
|
-
|
|
86
|
+
;// external "Vue"
|
|
87
|
+
const external_Vue_namespaceObject = require("Vue");
|
|
88
|
+
var external_Vue_default = /*#__PURE__*/__webpack_require__.n(external_Vue_namespaceObject);
|
|
89
|
+
;// external "ElementUI"
|
|
90
|
+
const external_ElementUI_namespaceObject = require("ElementUI");
|
|
91
|
+
var external_ElementUI_default = /*#__PURE__*/__webpack_require__.n(external_ElementUI_namespaceObject);
|
|
92
|
+
;// ./node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[2]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/button/index.vue?vue&type=template&id=55650f2e
|
|
93
|
+
var render = function render(){var _vm=this,_c=_vm._self._c;return _c('el-button',{on:{"click":_vm.handleClick}},[_vm._v(_vm._s(_vm.text))])
|
|
70
94
|
}
|
|
71
95
|
var staticRenderFns = []
|
|
72
96
|
|
|
73
97
|
|
|
98
|
+
;// ./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/button/index.vue?vue&type=script&lang=js
|
|
99
|
+
|
|
100
|
+
/* harmony default export */ const buttonvue_type_script_lang_js = ({
|
|
101
|
+
props:['text'],
|
|
102
|
+
name: 'XtButton',
|
|
103
|
+
methods:{
|
|
104
|
+
handleClick(){
|
|
105
|
+
this.$emit('click')
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
;// ./src/components/button/index.vue?vue&type=script&lang=js
|
|
111
|
+
/* harmony default export */ const components_buttonvue_type_script_lang_js = (buttonvue_type_script_lang_js);
|
|
74
112
|
;// ./node_modules/@vue/vue-loader-v15/lib/runtime/componentNormalizer.js
|
|
75
113
|
/* globals __VUE_SSR_CONTEXT__ */
|
|
76
114
|
|
|
@@ -169,15 +207,16 @@ function normalizeComponent(
|
|
|
169
207
|
}
|
|
170
208
|
}
|
|
171
209
|
|
|
172
|
-
;// ./src/components/
|
|
210
|
+
;// ./src/components/button/index.vue
|
|
211
|
+
|
|
212
|
+
|
|
173
213
|
|
|
174
|
-
var script = {}
|
|
175
214
|
|
|
176
215
|
|
|
177
216
|
/* normalize component */
|
|
178
217
|
;
|
|
179
218
|
var component = normalizeComponent(
|
|
180
|
-
|
|
219
|
+
components_buttonvue_type_script_lang_js,
|
|
181
220
|
render,
|
|
182
221
|
staticRenderFns,
|
|
183
222
|
false,
|
|
@@ -187,24 +226,43 @@ var component = normalizeComponent(
|
|
|
187
226
|
|
|
188
227
|
)
|
|
189
228
|
|
|
190
|
-
/* harmony default export */ const
|
|
191
|
-
;// ./
|
|
192
|
-
|
|
229
|
+
/* harmony default export */ const components_button = (component.exports);
|
|
230
|
+
;// ./src/components/button/index.js
|
|
231
|
+
|
|
232
|
+
/* harmony default export */ const src_components_button = (components_button);
|
|
233
|
+
;// ./node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[2]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/input/index.vue?vue&type=template&id=fe9146e4
|
|
234
|
+
var inputvue_type_template_id_fe9146e4_render = function render(){var _vm=this,_c=_vm._self._c;return _c('el-input',{attrs:{"value":_vm.value,"placeholder":_vm.placeholder},on:{"input":function($event){return _vm.$emit('input', $event)}}})
|
|
193
235
|
}
|
|
194
|
-
var
|
|
236
|
+
var inputvue_type_template_id_fe9146e4_staticRenderFns = []
|
|
237
|
+
|
|
238
|
+
|
|
239
|
+
;// ./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/input/index.vue?vue&type=script&lang=js
|
|
240
|
+
|
|
241
|
+
/* harmony default export */ const inputvue_type_script_lang_js = ({
|
|
242
|
+
name: 'XtInput',
|
|
243
|
+
props: {
|
|
244
|
+
value: [String, Number],
|
|
245
|
+
placeholder: {
|
|
246
|
+
type: String,
|
|
247
|
+
default: '请输入内容'
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
});
|
|
251
|
+
|
|
252
|
+
;// ./src/components/input/index.vue?vue&type=script&lang=js
|
|
253
|
+
/* harmony default export */ const components_inputvue_type_script_lang_js = (inputvue_type_script_lang_js);
|
|
254
|
+
;// ./src/components/input/index.vue
|
|
195
255
|
|
|
196
256
|
|
|
197
|
-
;// ./src/components/Input.vue
|
|
198
257
|
|
|
199
|
-
var Input_script = {}
|
|
200
258
|
|
|
201
259
|
|
|
202
260
|
/* normalize component */
|
|
203
261
|
;
|
|
204
|
-
var
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
262
|
+
var input_component = normalizeComponent(
|
|
263
|
+
components_inputvue_type_script_lang_js,
|
|
264
|
+
inputvue_type_template_id_fe9146e4_render,
|
|
265
|
+
inputvue_type_template_id_fe9146e4_staticRenderFns,
|
|
208
266
|
false,
|
|
209
267
|
null,
|
|
210
268
|
null,
|
|
@@ -212,17 +270,28 @@ var Input_component = normalizeComponent(
|
|
|
212
270
|
|
|
213
271
|
)
|
|
214
272
|
|
|
215
|
-
/* harmony default export */ const
|
|
273
|
+
/* harmony default export */ const input = (input_component.exports);
|
|
274
|
+
;// ./src/components/input/index.js
|
|
275
|
+
|
|
276
|
+
/* harmony default export */ const components_input = (input);
|
|
216
277
|
;// ./src/index.js
|
|
278
|
+
// 导入 Vue
|
|
279
|
+
|
|
280
|
+
|
|
281
|
+
// 导入 Element UI 并注册
|
|
282
|
+
|
|
283
|
+
|
|
284
|
+
|
|
217
285
|
// 导入组件
|
|
218
286
|
|
|
219
287
|
|
|
220
|
-
|
|
288
|
+
|
|
289
|
+
|
|
221
290
|
|
|
222
291
|
// 存储组件列表
|
|
223
292
|
const components = [
|
|
224
|
-
|
|
225
|
-
|
|
293
|
+
src_components_button,
|
|
294
|
+
components_input
|
|
226
295
|
]
|
|
227
296
|
|
|
228
297
|
// 定义 install 方法,Vue.use() 会自动调用
|
|
@@ -230,12 +299,16 @@ const install = function (Vue) {
|
|
|
230
299
|
if (install.installed) return
|
|
231
300
|
install.installed = true
|
|
232
301
|
|
|
233
|
-
//
|
|
302
|
+
// 注册 Element UI
|
|
303
|
+
Vue.use((external_ElementUI_default()))
|
|
304
|
+
|
|
305
|
+
// 全局注册所有 xt- 组件
|
|
234
306
|
components.forEach(component => {
|
|
235
307
|
Vue.component(component.name, component)
|
|
236
308
|
})
|
|
237
309
|
}
|
|
238
310
|
|
|
311
|
+
|
|
239
312
|
// 支持全局 script 标签引入
|
|
240
313
|
if (typeof window !== 'undefined' && window.Vue) {
|
|
241
314
|
install(window.Vue)
|
|
@@ -245,9 +318,37 @@ if (typeof window !== 'undefined' && window.Vue) {
|
|
|
245
318
|
/* harmony default export */ const src_0 = ({
|
|
246
319
|
install,
|
|
247
320
|
// 按需导出组件
|
|
248
|
-
Button:
|
|
249
|
-
Input:
|
|
321
|
+
Button: src_components_button,
|
|
322
|
+
Input: components_input,
|
|
323
|
+
// 导出 ElementUI 以便用户按需引入
|
|
324
|
+
ElementUI: (external_ElementUI_default())
|
|
250
325
|
});
|
|
326
|
+
|
|
327
|
+
// 导出 Vue 和 ElementUI 以便用户使用
|
|
328
|
+
|
|
329
|
+
|
|
330
|
+
// 导出主题切换工具函数
|
|
331
|
+
const setTheme = function(theme) {
|
|
332
|
+
const validThemes = ['light', 'dark', 'compact']
|
|
333
|
+
if (validThemes.includes(theme)) {
|
|
334
|
+
document.documentElement.setAttribute('data-theme', theme)
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
const setSize = function(size) {
|
|
339
|
+
const validSizes = ['small', 'medium', 'large']
|
|
340
|
+
if (validSizes.includes(size)) {
|
|
341
|
+
document.documentElement.setAttribute('data-size', size)
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
const getTheme = function() {
|
|
346
|
+
return document.documentElement.getAttribute('data-theme') || 'light'
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
const getSize = function() {
|
|
350
|
+
return document.documentElement.getAttribute('data-size') || 'medium'
|
|
351
|
+
}
|
|
251
352
|
;// ./node_modules/@vue/cli-service/lib/commands/build/entry-lib.js
|
|
252
353
|
|
|
253
354
|
|