Skip to content

Commit a6620cb

Browse files
authored
feat: add component Vue.use method (#197)
* feat: add Vue.use feat * feat: Vue.use method * docs: update docs
1 parent 2ed0d62 commit a6620cb

File tree

55 files changed

+539
-169
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+539
-169
lines changed

components/affix/index.jsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ const AffixProps = {
5555
prefixCls: PropTypes.string,
5656
}
5757

58-
export default {
58+
const Affix = {
5959
name: 'AAffix',
6060
props: AffixProps,
6161
mixins: [BaseMixin],
@@ -264,3 +264,9 @@ export default {
264264
},
265265
}
266266

267+
/* istanbul ignore next */
268+
Affix.install = function (Vue) {
269+
Vue.component(Affix.name, Affix)
270+
}
271+
272+
export default Affix

components/alert/index.jsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export const AlertProps = {
3030
banner: PropTypes.bool,
3131
}
3232

33-
export default {
33+
const Alert = {
3434
props: AlertProps,
3535
mixins: [BaseMixin],
3636
name: 'AAlert',
@@ -133,3 +133,10 @@ export default {
133133
},
134134
}
135135

136+
/* istanbul ignore next */
137+
Alert.install = function (Vue) {
138+
Vue.component(Alert.name, Alert)
139+
}
140+
141+
export default Alert
142+

components/anchor/index.jsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,11 @@ export { AnchorProps } from './Anchor'
55
export { AnchorLinkProps } from './AnchorLink'
66

77
Anchor.Link = AnchorLink
8+
9+
/* istanbul ignore next */
10+
Anchor.install = function (Vue) {
11+
Vue.component(Anchor.name, Anchor)
12+
Vue.component(Anchor.Link.name, Anchor.Link)
13+
}
14+
815
export default Anchor

components/auto-complete/index.jsx

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ const AutoCompleteProps = {
3131
// onSelect?: (value: SelectValue, option: Object) => any;
3232
}
3333

34-
export default {
34+
const AutoComplete = {
3535
name: 'AAutoComplete',
3636
props: {
3737
...AutoCompleteProps,
@@ -136,3 +136,12 @@ export default {
136136
},
137137
}
138138

139+
/* istanbul ignore next */
140+
AutoComplete.install = function (Vue) {
141+
Vue.component(AutoComplete.name, AutoComplete)
142+
Vue.component(AutoComplete.Option.name, AutoComplete.Option)
143+
Vue.component(AutoComplete.OptGroup.name, AutoComplete.OptGroup)
144+
}
145+
146+
export default AutoComplete
147+

components/avatar/index.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
11
import Avatar from './Avatar'
22

3+
/* istanbul ignore next */
4+
Avatar.install = function (Vue) {
5+
Vue.component(Avatar.name, Avatar)
6+
}
7+
38
export default Avatar

components/back-top/index.jsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const BackTopProps = {
2626
prefixCls: PropTypes.string,
2727
}
2828

29-
export default {
29+
const BackTop = {
3030
name: 'ABackTop',
3131
mixins: [BaseMixin],
3232
props: {
@@ -130,3 +130,9 @@ export default {
130130
},
131131
}
132132

133+
/* istanbul ignore next */
134+
BackTop.install = function (Vue) {
135+
Vue.component(BackTop.name, BackTop)
136+
}
137+
138+
export default BackTop

components/badge/index.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
11
import Badge from './Badge'
22

3+
/* istanbul ignore next */
4+
Badge.install = function (Vue) {
5+
Vue.component(Badge.name, Badge)
6+
}
7+
38
export default Badge
9+

components/breadcrumb/index.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,12 @@ import Breadcrumb from './Breadcrumb'
22
import BreadcrumbItem from './BreadcrumbItem'
33

44
Breadcrumb.Item = BreadcrumbItem
5+
6+
/* istanbul ignore next */
7+
Breadcrumb.install = function (Vue) {
8+
Vue.component(Breadcrumb.name, Breadcrumb)
9+
Vue.component(BreadcrumbItem.name, BreadcrumbItem)
10+
}
11+
512
export default Breadcrumb
13+

components/button/button.jsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,5 @@ export default {
134134
)
135135
}
136136
},
137-
138137
}
139138

components/button/index.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,12 @@ import Button from './button'
22
import ButtonGroup from './button-group'
33

44
Button.Group = ButtonGroup
5+
6+
/* istanbul ignore next */
7+
Button.install = function (Vue) {
8+
Vue.component(Button.name, Button)
9+
Vue.component(ButtonGroup.name, ButtonGroup)
10+
}
11+
512
export default Button
613

0 commit comments

Comments
 (0)