@uni_toolkit/vite-plugin-component-config 0.0.3 → 0.0.5
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 +25 -1
- package/package.json +11 -2
package/README.md
CHANGED
|
@@ -41,15 +41,21 @@ export default defineConfig({
|
|
|
41
41
|
### 修改 Vue 文件
|
|
42
42
|
|
|
43
43
|
```vue
|
|
44
|
+
// custom-component.vue
|
|
44
45
|
<template>
|
|
45
46
|
<view class="container">
|
|
46
47
|
<text>Hello World</text>
|
|
48
|
+
<test></test>
|
|
47
49
|
</view>
|
|
48
50
|
</template>
|
|
49
51
|
|
|
50
52
|
<script>
|
|
53
|
+
import test from '../sub1/test' // 引入子包中的vue组件
|
|
51
54
|
export default {
|
|
52
|
-
name: 'MyComponent'
|
|
55
|
+
name: 'MyComponent',
|
|
56
|
+
components: {
|
|
57
|
+
test
|
|
58
|
+
}
|
|
53
59
|
}
|
|
54
60
|
</script>
|
|
55
61
|
|
|
@@ -59,6 +65,7 @@ export default {
|
|
|
59
65
|
"usingComponents": {
|
|
60
66
|
"custom-button": "/components/custom-button"
|
|
61
67
|
},
|
|
68
|
+
"styleIsolation": "apply-shared",
|
|
62
69
|
"componentPlaceholder": {
|
|
63
70
|
"test": "view",
|
|
64
71
|
}
|
|
@@ -66,6 +73,23 @@ export default {
|
|
|
66
73
|
</component-config>
|
|
67
74
|
```
|
|
68
75
|
|
|
76
|
+
编译到小程序端生成的 `JSON 文件` 如下所示
|
|
77
|
+
|
|
78
|
+
```json
|
|
79
|
+
// custom-component.json
|
|
80
|
+
{
|
|
81
|
+
"component": true,
|
|
82
|
+
"usingComponents": {
|
|
83
|
+
"test": "../sub1/test",
|
|
84
|
+
"custom-button": "/components/custom-button"
|
|
85
|
+
},
|
|
86
|
+
"styleIsolation": "apply-shared",
|
|
87
|
+
"componentPlaceholder": {
|
|
88
|
+
"test": "view"
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
```
|
|
92
|
+
|
|
69
93
|
## 配置选项
|
|
70
94
|
|
|
71
95
|
```typescript
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uni_toolkit/vite-plugin-component-config",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.5",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "chouchouji <1305974212@qq.com>",
|
|
6
6
|
"type": "module",
|
|
@@ -11,6 +11,15 @@
|
|
|
11
11
|
"require": "./dist/index.cjs"
|
|
12
12
|
}
|
|
13
13
|
},
|
|
14
|
+
"keywords": [
|
|
15
|
+
"uni-app",
|
|
16
|
+
"vue3",
|
|
17
|
+
"miniprogram",
|
|
18
|
+
"vite",
|
|
19
|
+
"plugin",
|
|
20
|
+
"component",
|
|
21
|
+
"custom"
|
|
22
|
+
],
|
|
14
23
|
"publishConfig": {
|
|
15
24
|
"access": "public"
|
|
16
25
|
},
|
|
@@ -32,7 +41,7 @@
|
|
|
32
41
|
"vite": "^7.1.7",
|
|
33
42
|
"@rollup/pluginutils": "^5.3.0",
|
|
34
43
|
"lodash-es": "^4.17.21",
|
|
35
|
-
"@uni_toolkit/shared": "0.0.
|
|
44
|
+
"@uni_toolkit/shared": "0.0.5"
|
|
36
45
|
},
|
|
37
46
|
"devDependencies": {
|
|
38
47
|
"typescript": "5.3.3",
|