@star-ai/star-ui 0.1.8 → 0.1.9

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.
@@ -0,0 +1,8 @@
1
+
2
+ import StarButton from './StarButton.vue'
3
+
4
+ StarButton.install = function(Vue) {
5
+ Vue.component(StarButton.name, StarButton)
6
+ }
7
+
8
+ export default StarButton
@@ -0,0 +1,8 @@
1
+
2
+ import StarInput from './StarInput.vue'
3
+
4
+ StarInput.install = function(Vue) {
5
+ Vue.component(StarInput.name, StarInput)
6
+ }
7
+
8
+ export default StarInput
package/lib/index.js CHANGED
@@ -20,9 +20,9 @@ if (typeof window !== 'undefined' && window.Vue) {
20
20
  }
21
21
 
22
22
  export default {
23
- version: '0.1.8',
23
+ version: '0.1.9',
24
24
  install,
25
25
  // 按需导出所有组件
26
- Button: require('./components/Button').default,
27
- Input: require('./components/Input').default
26
+ StarButton: require('./components/StarButton').default,
27
+ StarInput: require('./components/StarInput').default
28
28
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@star-ai/star-ui",
3
- "version": "0.1.8",
3
+ "version": "0.1.9",
4
4
  "description": "基于Uniapp的Vue2组件库",
5
5
  "main": "lib/index.js",
6
6
  "module": "lib/index.js",
package/packages/index.js CHANGED
@@ -2,8 +2,8 @@
2
2
  import packageJson from '../../package.json'
3
3
 
4
4
  // 静态导入所有组件
5
- import StarButton from './components/Button/Button.vue'
6
- import StarInput from './components/Input/Input.vue'
5
+ import StarButton from './components/StarButton/StarButton.vue'
6
+ import StarInput from './components/StarInput/StarInput.vue'
7
7
 
8
8
  // 组件列表
9
9
  const components = [
@@ -14,12 +14,9 @@ const components = [
14
14
  // 安装函数
15
15
  const install = function(Vue, opts = {}) {
16
16
  components.forEach(component => {
17
- // 如果组件有install方法,使用install方法注册
18
- if (component.install) {
17
+ if(component.install) {
19
18
  Vue.use(component)
20
- }
21
- // 如果组件是Vue组件对象,直接注册
22
- else if (component.name) {
19
+ } else if (component.name) {
23
20
  Vue.component(component.name, component)
24
21
  }
25
22
  })
@@ -1,8 +0,0 @@
1
-
2
- import Button from './Button.vue'
3
-
4
- Button.install = function(Vue) {
5
- Vue.component(Button.name, Button)
6
- }
7
-
8
- export default Button
@@ -1,8 +0,0 @@
1
-
2
- import Input from './Input.vue'
3
-
4
- Input.install = function(Vue) {
5
- Vue.component(Input.name, Input)
6
- }
7
-
8
- export default Input