@star-ai/star-ui 0.1.12 → 0.1.14

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.
@@ -44,11 +44,6 @@
44
44
  export default {
45
45
  name: 'StarButton',
46
46
 
47
- // 为组件添加 install 方法,用于 Vue.use()
48
- install: function(Vue) {
49
- Vue.component(this.name, this)
50
- },
51
-
52
47
  // 组件属性定义
53
48
  props: {
54
49
  // 按钮类型
@@ -77,11 +77,6 @@
77
77
  export default {
78
78
  name: 'StarInput',
79
79
 
80
- // 为组件添加 install 方法,用于 Vue.use()
81
- install: function(Vue) {
82
- Vue.component(this.name, this)
83
- },
84
-
85
80
  props: {
86
81
  // 输入框类型
87
82
  type: {
package/lib/index.js CHANGED
@@ -1,24 +1,23 @@
1
1
 
2
2
  // 导入所有组件
3
- import Vue from 'vue'
4
-
5
- import StarButton from './components/StarButton'
6
- import StarInput from './components/StarInput'
3
+ import star-button from './components/star-button'
4
+ import star-input from './components/star-input'
7
5
 
8
6
  // 组件列表
9
- const components = [StarButton, StarInput]
7
+ const components = [star-button, star-input]
10
8
 
11
9
  // 安装函数
12
10
  const install = function(Vue, opts = {}) {
13
11
  components.forEach(component => {
14
- // 确保组件有name属性和install方法
15
- if (component.name && component.install) {
12
+ if(component.install) {
13
+ Vue.use(component)
14
+ } else if (component.name) {
16
15
  Vue.component(component.name, component)
17
16
  }
18
17
  })
19
18
 
20
19
  // 挂载全局方法
21
- Vue.prototype.$MY_UI = {
20
+ Vue.prototype.$STAR_UI = {
22
21
  size: opts.size || '',
23
22
  zIndex: opts.zIndex || 2000
24
23
  }
@@ -31,12 +30,12 @@ if (typeof window !== 'undefined' && window.Vue) {
31
30
 
32
31
  // 导出默认对象
33
32
  export default {
34
- version: '0.1.12',
33
+ version: '0.1.14',
35
34
  install,
36
35
  // 导出所有组件
37
- StarButton, StarInput
36
+ star-button, star-input
38
37
  }
39
38
 
40
39
  // 按需导出组件
41
- export { StarButton }
42
- export { StarInput }
40
+ export { star-button }
41
+ export { star-input }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@star-ai/star-ui",
3
- "version": "0.1.12",
3
+ "version": "0.1.14",
4
4
  "description": "基于Uniapp的Vue2组件库",
5
5
  "main": "lib/index.js",
6
6
  "module": "lib/index.js",
@@ -44,11 +44,6 @@
44
44
  export default {
45
45
  name: 'StarButton',
46
46
 
47
- // 为组件添加 install 方法,用于 Vue.use()
48
- install: function(Vue) {
49
- Vue.component(this.name, this)
50
- },
51
-
52
47
  // 组件属性定义
53
48
  props: {
54
49
  // 按钮类型
@@ -77,11 +77,6 @@
77
77
  export default {
78
78
  name: 'StarInput',
79
79
 
80
- // 为组件添加 install 方法,用于 Vue.use()
81
- install: function(Vue) {
82
- Vue.component(this.name, this)
83
- },
84
-
85
80
  props: {
86
81
  // 输入框类型
87
82
  type: {
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/StarButton/StarButton.vue'
6
- import StarInput from './components/StarInput/StarInput.vue'
5
+ import StarButton from './components/star-button/star-button.vue'
6
+ import StarInput from './components/star-input/star-input.vue'
7
7
 
8
8
  // 组件列表
9
9
  const components = [
@@ -1,9 +0,0 @@
1
-
2
- import StarButton from './StarButton.vue'
3
-
4
- // 确保组件有install方法
5
- StarButton.install = function(Vue) {
6
- Vue.component(StarButton.name, StarButton)
7
- }
8
-
9
- export default StarButton
@@ -1,9 +0,0 @@
1
-
2
- import StarInput from './StarInput.vue'
3
-
4
- // 确保组件有install方法
5
- StarInput.install = function(Vue) {
6
- Vue.component(StarInput.name, StarInput)
7
- }
8
-
9
- export default StarInput