Skip to content

Commit c9f1c26

Browse files
committed
chore: add base.vue inconsistent vue version
1 parent d459b20 commit c9f1c26

File tree

64 files changed

+145
-15
lines changed

Some content is hidden

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

64 files changed

+145
-15
lines changed

components/_util/ContainerRender.jsx

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import Vue from 'vue';
22
import PropTypes from './vue-types';
3+
import Base from '../base';
34

45
export default {
56
props: {
@@ -51,9 +52,9 @@ export default {
5152
this.componentEl = el;
5253
this.container.appendChild(el);
5354
}
54-
5555
if (!this._component) {
56-
this._component = new Vue({
56+
const V = Base.Vue || Vue;
57+
this._component = new V({
5758
el: el,
5859
parent: self.parent,
5960
data: {

components/_util/antDirective.js

+2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1+
import ref from 'vue-ref';
12
import { antInput } from './antInputDirective';
23
import { antDecorator } from './FormDecoratorDirective';
34

45
export default {
56
install: Vue => {
7+
Vue.use(ref, { name: 'ant-ref' });
68
antInput(Vue);
79
antDecorator(Vue);
810
},

components/affix/index.jsx

+2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import omit from 'omit.js';
66
import getScroll from '../_util/getScroll';
77
import BaseMixin from '../_util/BaseMixin';
88
import throttleByAnimationFrame from '../_util/throttleByAnimationFrame';
9+
import Base from '../base';
910

1011
function getTargetRect(target) {
1112
return target !== window ? target.getBoundingClientRect() : { top: 0, left: 0, bottom: 0 };
@@ -259,6 +260,7 @@ const Affix = {
259260

260261
/* istanbul ignore next */
261262
Affix.install = function(Vue) {
263+
Vue.use(Base);
262264
Vue.component(Affix.name, Affix);
263265
};
264266

components/alert/index.jsx

+2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import PropTypes from '../_util/vue-types';
55
import getTransitionProps from '../_util/getTransitionProps';
66
import { getComponentFromProp, isValidElement } from '../_util/props-util';
77
import { cloneElement } from '../_util/vnode';
8+
import Base from '../base';
89
function noop() {}
910
export const AlertProps = {
1011
/**
@@ -150,6 +151,7 @@ const Alert = {
150151

151152
/* istanbul ignore next */
152153
Alert.install = function(Vue) {
154+
Vue.use(Base);
153155
Vue.component(Alert.name, Alert);
154156
};
155157

components/anchor/index.jsx

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
import Anchor from './Anchor';
22
import AnchorLink from './AnchorLink';
3-
4-
export { AnchorProps } from './Anchor';
5-
export { AnchorLinkProps } from './AnchorLink';
3+
import Base from '../base';
64

75
Anchor.Link = AnchorLink;
86

97
/* istanbul ignore next */
108
Anchor.install = function(Vue) {
9+
Vue.use(Base);
1110
Vue.component(Anchor.name, Anchor);
1211
Vue.component(Anchor.Link.name, Anchor.Link);
1312
};
14-
13+
export { AnchorProps } from './Anchor';
14+
export { AnchorLinkProps } from './AnchorLink';
1515
export default Anchor;

components/auto-complete/index.jsx

+2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import {
99
filterEmpty,
1010
isValidElement,
1111
} from '../_util/props-util';
12+
import Base from '../base';
1213

1314
// const DataSourceItemObject = PropTypes.shape({
1415
// value: String,
@@ -135,6 +136,7 @@ const AutoComplete = {
135136

136137
/* istanbul ignore next */
137138
AutoComplete.install = function(Vue) {
139+
Vue.use(Base);
138140
Vue.component(AutoComplete.name, AutoComplete);
139141
Vue.component(AutoComplete.Option.name, AutoComplete.Option);
140142
Vue.component(AutoComplete.OptGroup.name, AutoComplete.OptGroup);

components/avatar/index.js

+2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
import Avatar from './Avatar';
2+
import Base from '../base';
23

34
/* istanbul ignore next */
45
Avatar.install = function(Vue) {
6+
Vue.use(Base);
57
Vue.component(Avatar.name, Avatar);
68
};
79

components/back-top/index.jsx

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import addEventListener from '../_util/Dom/addEventListener';
44
import getScroll from '../_util/getScroll';
55
import BaseMixin from '../_util/BaseMixin';
66
import getTransitionProps from '../_util/getTransitionProps';
7+
import Base from '../base';
78

89
const easeInOutCubic = (t, b, c, d) => {
910
const cc = c - b;
@@ -126,6 +127,7 @@ const BackTop = {
126127

127128
/* istanbul ignore next */
128129
BackTop.install = function(Vue) {
130+
Vue.use(Base);
129131
Vue.component(BackTop.name, BackTop);
130132
};
131133

components/badge/index.js

+2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
import Badge from './Badge';
2+
import Base from '../base';
23

34
/* istanbul ignore next */
45
Badge.install = function(Vue) {
6+
Vue.use(Base);
57
Vue.component(Badge.name, Badge);
68
};
79

components/base/index.js

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import antDirective from '../_util/antDirective';
2+
const base = {};
3+
const install = function(Vue) {
4+
base.Vue = Vue;
5+
Vue.use(antDirective);
6+
};
7+
base.install = install;
8+
9+
export default base;

components/base/style/index.js

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
// empty file prevent babel-plugin-import error
2+
import '../../style/index.less';

components/breadcrumb/index.js

+2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
import Breadcrumb from './Breadcrumb';
22
import BreadcrumbItem from './BreadcrumbItem';
3+
import Base from '../base';
34

45
Breadcrumb.Item = BreadcrumbItem;
56

67
/* istanbul ignore next */
78
Breadcrumb.install = function(Vue) {
9+
Vue.use(Base);
810
Vue.component(Breadcrumb.name, Breadcrumb);
911
Vue.component(BreadcrumbItem.name, BreadcrumbItem);
1012
};

components/button/index.js

+2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
import Button from './button';
22
import ButtonGroup from './button-group';
3+
import Base from '../base';
34

45
Button.Group = ButtonGroup;
56

67
/* istanbul ignore next */
78
Button.install = function(Vue) {
9+
Vue.use(Base);
810
Vue.component(Button.name, Button);
911
Vue.component(ButtonGroup.name, ButtonGroup);
1012
};

components/calendar/index.jsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ import { PREFIX_CLS } from './Constants';
88
import Header from './Header';
99
import interopDefault from '../_util/interopDefault';
1010
import enUS from './locale/en_US';
11-
12-
export { HeaderProps } from './Header';
11+
import Base from '../base';
1312

1413
function noop() {
1514
return null;
@@ -242,7 +241,8 @@ const Calendar = {
242241

243242
/* istanbul ignore next */
244243
Calendar.install = function(Vue) {
244+
Vue.use(Base);
245245
Vue.component(Calendar.name, Calendar);
246246
};
247-
247+
export { HeaderProps } from './Header';
248248
export default Calendar;

components/card/index.js

+2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
import Card from './Card';
22
import Meta from './Meta';
33
import Grid from './Grid';
4+
import Base from '../base';
45
Card.Meta = Meta;
56
Card.Grid = Grid;
67

78
/* istanbul ignore next */
89
Card.install = function(Vue) {
10+
Vue.use(Base);
911
Vue.component(Card.name, Card);
1012
Vue.component(Meta.name, Meta);
1113
Vue.component(Grid.name, Grid);

components/carousel/index.jsx

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import PropTypes from '../_util/vue-types';
22
import debounce from 'lodash/debounce';
33
import { initDefaultProps, getComponentFromProp, filterEmpty } from '../_util/props-util';
4+
import Base from '../base';
45

56
// matchMedia polyfill for
67
// https://github.com/WickyNilliams/enquire.js/issues/82
@@ -163,6 +164,7 @@ const Carousel = {
163164

164165
/* istanbul ignore next */
165166
Carousel.install = function(Vue) {
167+
Vue.use(Base);
166168
Vue.component(Carousel.name, Carousel);
167169
};
168170

components/cascader/index.jsx

+2
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import {
1919
import BaseMixin from '../_util/BaseMixin';
2020
import { cloneElement } from '../_util/vnode';
2121
import warning from '../_util/warning';
22+
import Base from '../base';
2223

2324
const CascaderOptionType = PropTypes.shape({
2425
value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
@@ -528,6 +529,7 @@ const Cascader = {
528529

529530
/* istanbul ignore next */
530531
Cascader.install = function(Vue) {
532+
Vue.use(Base);
531533
Vue.component(Cascader.name, Cascader);
532534
};
533535

components/checkbox/index.js

+2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
import Checkbox from './Checkbox';
22
import CheckboxGroup from './Group';
3+
import Base from '../base';
34

45
Checkbox.Group = CheckboxGroup;
56

67
/* istanbul ignore next */
78
Checkbox.install = function(Vue) {
9+
Vue.use(Base);
810
Vue.component(Checkbox.name, Checkbox);
911
Vue.component(CheckboxGroup.name, CheckboxGroup);
1012
};

components/col/index.js

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import { Col } from '../grid';
2+
import Base from '../base';
23
/* istanbul ignore next */
34
Col.install = function(Vue) {
5+
Vue.use(Base);
46
Vue.component(Col.name, Col);
57
};
68

components/collapse/index.js

+2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
import Collapse from './Collapse';
22
import CollapsePanel from './CollapsePanel';
3+
import Base from '../base';
34

45
Collapse.Panel = CollapsePanel;
56

67
/* istanbul ignore next */
78
Collapse.install = function(Vue) {
9+
Vue.use(Base);
810
Vue.component(Collapse.name, Collapse);
911
Vue.component(CollapsePanel.name, CollapsePanel);
1012
};

components/comment/index.jsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import PropsTypes from '../_util/vue-types';
22
import { initDefaultProps, getComponentFromProp } from '../_util/props-util';
3-
3+
import Base from '../base';
44
export const CommentProps = {
55
actions: PropsTypes.array,
66
/** The element to display as the comment author. */
@@ -88,6 +88,7 @@ const Comment = {
8888

8989
/* istanbul ignore next */
9090
Comment.install = function(Vue) {
91+
Vue.use(Base);
9192
Vue.component(Comment.name, Comment);
9293
};
9394
export default Comment;

components/config-provider/index.jsx

+2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import PropTypes from '../_util/vue-types';
2+
import Base from '../base';
23

34
const ConfigProvider = {
45
name: 'AConfigProvider',
@@ -17,6 +18,7 @@ const ConfigProvider = {
1718

1819
/* istanbul ignore next */
1920
ConfigProvider.install = function(Vue) {
21+
Vue.use(Base);
2022
Vue.component(ConfigProvider.name, ConfigProvider);
2123
};
2224

components/date-picker/index.js

+2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import wrapPicker from './wrapPicker';
55
import RangePicker from './RangePicker';
66
import WeekPicker from './WeekPicker';
77
import { DatePickerProps, MonthPickerProps, WeekPickerProps, RangePickerProps } from './interface';
8+
import Base from '../base';
89

910
const DatePicker = wrapPicker(
1011
{ ...createPicker(VcCalendar, DatePickerProps()), name: 'ADatePicker' },
@@ -25,6 +26,7 @@ Object.assign(DatePicker, {
2526

2627
/* istanbul ignore next */
2728
DatePicker.install = function(Vue) {
29+
Vue.use(Base);
2830
Vue.component(DatePicker.name, DatePicker);
2931
Vue.component(DatePicker.RangePicker.name, DatePicker.RangePicker);
3032
Vue.component(DatePicker.MonthPicker.name, DatePicker.MonthPicker);

components/divider/index.jsx

+2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import PropTypes from '../_util/vue-types';
2+
import Base from '../base';
23
const Divider = {
34
name: 'ADivider',
45
props: {
@@ -32,6 +33,7 @@ const Divider = {
3233

3334
/* istanbul ignore next */
3435
Divider.install = function(Vue) {
36+
Vue.use(Base);
3537
Vue.component(Divider.name, Divider);
3638
};
3739

components/drawer/index.jsx

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import PropTypes from '../_util/vue-types';
44
import BaseMixin from '../_util/BaseMixin';
55
import Icon from '../icon';
66
import { getComponentFromProp, getOptionProps } from '../_util/props-util';
7+
import Base from '../base';
78

89
const Drawer = {
910
name: 'ADrawer',
@@ -208,6 +209,7 @@ const Drawer = {
208209

209210
/* istanbul ignore next */
210211
Drawer.install = function(Vue) {
212+
Vue.use(Base);
211213
Vue.component(Drawer.name, Drawer);
212214
};
213215

components/dropdown/index.js

+2
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,13 @@ import DropdownButton from './dropdown-button';
33

44
export { DropdownProps } from './dropdown';
55
export { DropdownButtonProps } from './dropdown-button';
6+
import Base from '../base';
67

78
Dropdown.Button = DropdownButton;
89

910
/* istanbul ignore next */
1011
Dropdown.install = function(Vue) {
12+
Vue.use(Base);
1113
Vue.component(Dropdown.name, Dropdown);
1214
Vue.component(DropdownButton.name, DropdownButton);
1315
};

components/form/Form.jsx

+3-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import createFormField from '../vc-form/src/createFormField';
88
import FormItem from './FormItem';
99
import { FIELD_META_PROP, FIELD_DATA_PROP } from './constants';
1010
import { initDefaultProps } from '../_util/props-util';
11+
import Base from '../base';
1112

1213
export const FormCreateOption = {
1314
onFieldsChange: PropTypes.func,
@@ -137,7 +138,8 @@ const Form = {
137138
});
138139
},
139140
createForm(context, options = {}) {
140-
return new Vue(Form.create({ ...options, templateContext: context })());
141+
const V = Base.Vue || Vue;
142+
return new V(Form.create({ ...options, templateContext: context })());
141143
},
142144
created() {
143145
this.formItemContexts = new Map();

components/form/index.jsx

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import Vue from 'vue';
22
import Form from './Form';
33
import ref from 'vue-ref';
44
import FormDecoratorDirective from '../_util/FormDecoratorDirective';
5+
import Base from '../base';
56

67
Vue.use(ref, { name: 'ant-ref' });
78
Vue.use(FormDecoratorDirective);
@@ -12,6 +13,7 @@ export { FormItemProps } from './FormItem';
1213

1314
/* istanbul ignore next */
1415
Form.install = function(Vue) {
16+
Vue.use(Base);
1517
Vue.component(Form.name, Form);
1618
Vue.component(Form.Item.name, Form.Item);
1719
Vue.prototype.$form = Form;

0 commit comments

Comments
 (0)