@star-ai/star-ui 0.1.10 → 0.1.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/lib/index.js
CHANGED
|
@@ -1,10 +1,18 @@
|
|
|
1
1
|
|
|
2
|
-
//
|
|
3
|
-
|
|
2
|
+
// 导入所有组件
|
|
3
|
+
import StarButton from './components/StarButton'
|
|
4
|
+
import StarInput from './components/StarInput'
|
|
4
5
|
|
|
6
|
+
// 组件列表
|
|
7
|
+
const components = [StarButton, StarInput]
|
|
8
|
+
|
|
9
|
+
// 安装函数
|
|
5
10
|
const install = function(Vue, opts = {}) {
|
|
6
11
|
components.forEach(component => {
|
|
7
|
-
|
|
12
|
+
// 确保组件有name属性和install方法
|
|
13
|
+
if (component.name && component.install) {
|
|
14
|
+
Vue.component(component.name, component)
|
|
15
|
+
}
|
|
8
16
|
})
|
|
9
17
|
|
|
10
18
|
// 挂载全局方法
|
|
@@ -19,10 +27,14 @@ if (typeof window !== 'undefined' && window.Vue) {
|
|
|
19
27
|
install(window.Vue)
|
|
20
28
|
}
|
|
21
29
|
|
|
30
|
+
// 导出默认对象
|
|
22
31
|
export default {
|
|
23
|
-
version: '0.1.
|
|
32
|
+
version: '0.1.11',
|
|
24
33
|
install,
|
|
25
|
-
//
|
|
26
|
-
StarButton
|
|
27
|
-
StarInput: require('./components/StarInput').default
|
|
34
|
+
// 导出所有组件
|
|
35
|
+
StarButton, StarInput
|
|
28
36
|
}
|
|
37
|
+
|
|
38
|
+
// 按需导出组件
|
|
39
|
+
export { StarButton }
|
|
40
|
+
export { StarInput }
|