icarys-fc-vant 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/README.md +69 -5
- package/package.json +6 -8
- package/dist/index.js +0 -7525
- package/dist/index.min.js +0 -8
- package/dist/index.min.js.map +0 -1
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# icarys
|
|
1
|
+
# @icarys/fc-vant
|
|
2
2
|
|
|
3
3
|
基于 FormCreate 和 Vant 的移动端低代码表单组件库
|
|
4
4
|
|
|
@@ -14,12 +14,76 @@
|
|
|
14
14
|
|
|
15
15
|
```bash
|
|
16
16
|
# 安装组件库
|
|
17
|
-
npm install icarys
|
|
17
|
+
npm install @icarys/fc-vant
|
|
18
18
|
|
|
19
19
|
# 安装必需的依赖(Vue 3 和 Vant)
|
|
20
20
|
npm install vue@^3.1.0 vant@^4.0.0
|
|
21
21
|
```
|
|
22
22
|
|
|
23
|
+
## 项目配置
|
|
24
|
+
|
|
25
|
+
⚠️ **重要**: 此包包含源文件和JSX代码,您需要在项目中配置对JSX的支持:
|
|
26
|
+
|
|
27
|
+
### Vue CLI 项目
|
|
28
|
+
|
|
29
|
+
确保 `vue.config.js` 中配置了JSX:
|
|
30
|
+
|
|
31
|
+
```javascript
|
|
32
|
+
// vue.config.js
|
|
33
|
+
module.exports = {
|
|
34
|
+
configureWebpack: {
|
|
35
|
+
resolve: {
|
|
36
|
+
extensions: ['.js', '.jsx', '.vue']
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### Vite 项目
|
|
43
|
+
|
|
44
|
+
确保 `vite.config.js` 中配置了对JSX的支持:
|
|
45
|
+
|
|
46
|
+
```javascript
|
|
47
|
+
// vite.config.js
|
|
48
|
+
import { defineConfig } from 'vite'
|
|
49
|
+
import vue from '@vitejs/plugin-vue'
|
|
50
|
+
import vueJsx from '@vitejs/plugin-vue-jsx'
|
|
51
|
+
|
|
52
|
+
export default defineConfig({
|
|
53
|
+
plugins: [
|
|
54
|
+
vue(),
|
|
55
|
+
vueJsx() // 添加JSX支持
|
|
56
|
+
]
|
|
57
|
+
})
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### Webpack 项目
|
|
61
|
+
|
|
62
|
+
在 `webpack.config.js` 中添加JSX支持:
|
|
63
|
+
|
|
64
|
+
```javascript
|
|
65
|
+
module.exports = {
|
|
66
|
+
resolve: {
|
|
67
|
+
extensions: ['.js', '.jsx', '.vue']
|
|
68
|
+
},
|
|
69
|
+
module: {
|
|
70
|
+
rules: [
|
|
71
|
+
{
|
|
72
|
+
test: /\.jsx?$/,
|
|
73
|
+
exclude: /node_modules/,
|
|
74
|
+
use: {
|
|
75
|
+
loader: 'babel-loader',
|
|
76
|
+
options: {
|
|
77
|
+
presets: ['@babel/preset-env'],
|
|
78
|
+
plugins: ['@vue/babel-plugin-jsx']
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
]
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
```
|
|
86
|
+
|
|
23
87
|
## 使用
|
|
24
88
|
|
|
25
89
|
### 基础用法
|
|
@@ -32,7 +96,7 @@ npm install vue@^3.1.0 vant@^4.0.0
|
|
|
32
96
|
import Vue from 'vue'
|
|
33
97
|
import Vant from 'vant'
|
|
34
98
|
import 'vant/lib/index.css'
|
|
35
|
-
import formCreate from 'icarys
|
|
99
|
+
import formCreate from '@icarys/fc-vant'
|
|
36
100
|
|
|
37
101
|
Vue.use(Vant)
|
|
38
102
|
|
|
@@ -72,7 +136,7 @@ $f.submit().then(data => {
|
|
|
72
136
|
#### 使用工具方法
|
|
73
137
|
|
|
74
138
|
```javascript
|
|
75
|
-
import formCreate from 'icarys
|
|
139
|
+
import formCreate from '@icarys/fc-vant'
|
|
76
140
|
|
|
77
141
|
// 解析JSON规则
|
|
78
142
|
const rules = formCreate.jsonParse('[{"type":"input","field":"name"}]')
|
|
@@ -94,7 +158,7 @@ const $f = formCreate.create(rules)
|
|
|
94
158
|
</template>
|
|
95
159
|
|
|
96
160
|
<script>
|
|
97
|
-
import { formCreateMobile } from 'icarys
|
|
161
|
+
import { formCreateMobile } from '@icarys/fc-vant'
|
|
98
162
|
|
|
99
163
|
export default {
|
|
100
164
|
mounted() {
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "icarys-fc-vant",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "基于FormCreate和Vant的移动端低代码表单组件库,可以通过JSON生成具有动态渲染、数据收集、验证和提交功能的表单",
|
|
5
|
-
"main": "./
|
|
6
|
-
"module": "./
|
|
7
|
-
"unpkg": "./
|
|
8
|
-
"jsdelivr": "./
|
|
5
|
+
"main": "./src/index.js",
|
|
6
|
+
"module": "./src/index.js",
|
|
7
|
+
"unpkg": "./src/index.js",
|
|
8
|
+
"jsdelivr": "./src/index.js",
|
|
9
9
|
"typings": "./types/index.d.ts",
|
|
10
10
|
"scripts": {
|
|
11
11
|
"clean": "rimraf dist/",
|
|
@@ -14,7 +14,6 @@
|
|
|
14
14
|
"dev": "vue-cli-service serve src/vant/examples",
|
|
15
15
|
"pub": "npm run build && npm publish"
|
|
16
16
|
},
|
|
17
|
-
|
|
18
17
|
"keywords": [
|
|
19
18
|
"vue3",
|
|
20
19
|
"vant",
|
|
@@ -30,8 +29,7 @@
|
|
|
30
29
|
"package.json",
|
|
31
30
|
"LICENSE",
|
|
32
31
|
"src",
|
|
33
|
-
"types"
|
|
34
|
-
"dist"
|
|
32
|
+
"types"
|
|
35
33
|
],
|
|
36
34
|
"author": "lvyanrui",
|
|
37
35
|
"license": "MIT",
|