el-plus-crud 0.0.9 → 0.0.11
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/CHANGELOG.md +4 -0
- package/build.js +9 -0
- package/dist/el-plus-crud.umd.cjs +27 -0
- package/lib/components/el-plus-form/components/index.ts +0 -2
- package/lib/index.ts +79 -14
- package/package.json +3 -1
- package/tsconfig.json +1 -1
- package/dist/el-plus-crud.umd.js +0 -27
- /package/lib/{defaults.d.ts → default.d.ts} +0 -0
package/lib/index.ts
CHANGED
|
@@ -1,28 +1,93 @@
|
|
|
1
1
|
import { App } from 'vue'
|
|
2
2
|
import ElPlusForm from './components/el-plus-form/ElPlusForm.vue'
|
|
3
3
|
import ElPlusFormDialog from './components/el-plus-form/ElPlusFormDialog.vue'
|
|
4
|
-
|
|
4
|
+
import { components } from './components/el-plus-form/components/index'
|
|
5
5
|
import ElPlusTable from './components/el-plus-table/ElPlusTable.vue'
|
|
6
6
|
|
|
7
|
+
// import ElPlusFormBtn from './components/el-plus-form/components/ElPlusFormBtn.vue'
|
|
8
|
+
// import ElPlusFormBtns from './components/el-plus-form/components/ElPlusFormBtns.vue'
|
|
9
|
+
// import ElPlusFormCascader from './components/el-plus-form/components/ElPlusFormCascader.vue'
|
|
10
|
+
// import ElPlusFormCascaderPanel from './components/el-plus-form/components/ElPlusFormCascaderPanel.vue'
|
|
11
|
+
// import ElPlusFormCheckbox from './components/el-plus-form/components/ElPlusFormCheckbox.vue'
|
|
12
|
+
// import ElPlusFormCheckboxButton from './components/el-plus-form/components/ElPlusFormCheckboxButton.vue'
|
|
13
|
+
// import ElPlusFormDate from './components/el-plus-form/components/ElPlusFormDate.vue'
|
|
14
|
+
// import ElPlusFormDaterange from './components/el-plus-form/components/ElPlusFormDaterange.vue'
|
|
15
|
+
// import ElPlusFormFile from './components/el-plus-form/components/ElPlusFormFile.vue'
|
|
16
|
+
// import ElPlusFormImage from './components/el-plus-form/components/ElPlusFormImage.vue'
|
|
17
|
+
// import ElPlusFormInput from './components/el-plus-form/components/ElPlusFormInput.vue'
|
|
18
|
+
// import ElPlusFormLink from './components/el-plus-form/components/ElPlusFormLink.vue'
|
|
19
|
+
// import ElPlusFormNbinput from './components/el-plus-form/components/ElPlusFormNbinput.vue'
|
|
20
|
+
// import ElPlusFormNumber from './components/el-plus-form/components/ElPlusFormNumber.vue'
|
|
21
|
+
// import ElPlusFormPassword from './components/el-plus-form/components/ElPlusFormPassword.vue'
|
|
22
|
+
// import ElPlusFormRadio from './components/el-plus-form/components/ElPlusFormRadio.vue'
|
|
23
|
+
// import ElPlusFormRate from './components/el-plus-form/components/ElPlusFormRate.vue'
|
|
24
|
+
// import ElPlusFormSelect from './components/el-plus-form/components/ElPlusFormSelect.vue'
|
|
25
|
+
// import ElPlusFormSlider from './components/el-plus-form/components/ElPlusFormSlider.vue'
|
|
26
|
+
// import ElPlusFormStatus from './components/el-plus-form/components/ElPlusFormStatus.vue'
|
|
27
|
+
// import ElPlusFormSwitch from './components/el-plus-form/components/ElPlusFormSwitch.vue'
|
|
28
|
+
// import ElPlusFormTag from './components/el-plus-form/components/ElPlusFormTag.vue'
|
|
29
|
+
// import ElPlusFormText from './components/el-plus-form/components/ElPlusFormText.vue'
|
|
30
|
+
// import ElPlusFormTextarea from './components/el-plus-form/components/ElPlusFormTextarea.vue'
|
|
31
|
+
// import ElPlusFormTree from './components/el-plus-form/components/ElPlusFormTree.vue'
|
|
32
|
+
// import ElPlusFormTreeSelect from './components/el-plus-form/components/ElPlusFormTreeSelect.vue'
|
|
33
|
+
|
|
7
34
|
export default {
|
|
8
35
|
install: (app: App, config: { [key: string]: any }, format?: { [key: string]: Function }, globalData?: { [key: string]: Function }) => {
|
|
9
36
|
console.log('initConfig: ', config)
|
|
10
37
|
|
|
11
|
-
|
|
38
|
+
console.log('components1: ', components)
|
|
39
|
+
if (!components || components.length <= 0) {
|
|
40
|
+
const modulesFiles = import.meta.glob('./components/el-plus-form/components/*.vue', { eager: true }) // import.meta.globEager('./*.vue')
|
|
41
|
+
console.log('modulesFiles: ', modulesFiles)
|
|
42
|
+
// 递归
|
|
43
|
+
for (const file in modulesFiles) {
|
|
44
|
+
const tempComponent = (modulesFiles[file] as any).default
|
|
45
|
+
console.log('file: ', file, tempComponent)
|
|
46
|
+
components.push(tempComponent)
|
|
47
|
+
}
|
|
48
|
+
}
|
|
12
49
|
|
|
13
|
-
|
|
14
|
-
const
|
|
50
|
+
console.log('components2: ', components)
|
|
51
|
+
// const components: any[] = [
|
|
52
|
+
// ElPlusFormBtn,
|
|
53
|
+
// ElPlusFormBtns,
|
|
54
|
+
// ElPlusFormCascader,
|
|
55
|
+
// ElPlusFormCascaderPanel,
|
|
56
|
+
// ElPlusFormCheckbox,
|
|
57
|
+
// ElPlusFormCheckboxButton,
|
|
58
|
+
// ElPlusFormDate,
|
|
59
|
+
// ElPlusFormDaterange,
|
|
60
|
+
// ElPlusFormFile,
|
|
61
|
+
// ElPlusFormImage,
|
|
62
|
+
// ElPlusFormInput,
|
|
63
|
+
// ElPlusFormLink,
|
|
64
|
+
// ElPlusFormNbinput,
|
|
65
|
+
// ElPlusFormNumber,
|
|
66
|
+
// ElPlusFormPassword,
|
|
67
|
+
// ElPlusFormRadio,
|
|
68
|
+
// ElPlusFormRate,
|
|
69
|
+
// ElPlusFormSelect,
|
|
70
|
+
// ElPlusFormSlider,
|
|
71
|
+
// ElPlusFormStatus,
|
|
72
|
+
// ElPlusFormSwitch,
|
|
73
|
+
// ElPlusFormTag,
|
|
74
|
+
// ElPlusFormText,
|
|
75
|
+
// ElPlusFormTextarea,
|
|
76
|
+
// ElPlusFormTree,
|
|
77
|
+
// ElPlusFormTreeSelect
|
|
78
|
+
// ]
|
|
79
|
+
// const typeList: String[] = []
|
|
15
80
|
|
|
16
|
-
console.log('modulesFiles*********: ', modulesFiles)
|
|
81
|
+
// console.log('modulesFiles*********: ', modulesFiles)
|
|
17
82
|
|
|
18
|
-
// 递归
|
|
19
|
-
for (const file in modulesFiles) {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}
|
|
83
|
+
// // 递归
|
|
84
|
+
// for (const file in modulesFiles) {
|
|
85
|
+
// const tempComponent = (modulesFiles[file] as any).default
|
|
86
|
+
// components.push(tempComponent)
|
|
87
|
+
// if (tempComponent.typeName) {
|
|
88
|
+
// typeList.push(tempComponent.typeName)
|
|
89
|
+
// }
|
|
90
|
+
// }
|
|
26
91
|
|
|
27
92
|
// 这里注入format对象
|
|
28
93
|
app.provide('format', format)
|
|
@@ -35,7 +100,7 @@ export default {
|
|
|
35
100
|
// 注册列表组件
|
|
36
101
|
components.push(ElPlusTable)
|
|
37
102
|
|
|
38
|
-
console.log('
|
|
103
|
+
console.log('components3: ', components)
|
|
39
104
|
|
|
40
105
|
components.map((component: any) => {
|
|
41
106
|
app.component(component.name, component)
|
package/package.json
CHANGED
|
@@ -2,15 +2,17 @@
|
|
|
2
2
|
"name": "el-plus-crud",
|
|
3
3
|
"description": "采用Vue3 + TS,封装的element-plus数据驱动表单、列表组件",
|
|
4
4
|
"author": "K.D.Jack",
|
|
5
|
-
"version": "0.0.
|
|
5
|
+
"version": "0.0.11",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"private": false,
|
|
8
8
|
"main": "dist/el-plus-crud.umd.cjs",
|
|
9
9
|
"module": "lib/index",
|
|
10
10
|
"types": "lib/index.d.ts",
|
|
11
|
+
"type": "module",
|
|
11
12
|
"scripts": {
|
|
12
13
|
"start": "vite",
|
|
13
14
|
"build": "vite build",
|
|
15
|
+
"build-comp": "node ./build.js",
|
|
14
16
|
"lint-fix": "eslint --fix --ext .js --ext .jsx --ext .vue lib/",
|
|
15
17
|
"preview": "vite preview",
|
|
16
18
|
"release": "standard-version",
|
package/tsconfig.json
CHANGED
|
@@ -63,6 +63,6 @@
|
|
|
63
63
|
"forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */,
|
|
64
64
|
"suppressImplicitAnyIndexErrors": true
|
|
65
65
|
},
|
|
66
|
-
"include": ["types/*.d.ts", "lib/**/*.ts", "lib/**/*.vue", "lib/**/*.tsx", "lib/**/*.d.ts", "lib/views/home/activeInfo/.vue.ts"], // **Represents any directory, and * represents any file. Indicates that all files in the src directory will be compiled
|
|
66
|
+
"include": ["types/*.d.ts", "lib/**/*.ts", "lib/**/*.vue", "lib/**/*.tsx", "lib/**/*.d.ts", "lib/views/home/activeInfo/.vue.ts", "lib/components/el-plus-form/components/index.ts"], // **Represents any directory, and * represents any file. Indicates that all files in the src directory will be compiled
|
|
67
67
|
"exclude": ["node_modules", "dist"] // Indicates the file directory that does not need to be compiled
|
|
68
68
|
}
|