chore: add base.vue inconsistent vue version

pull/1143/head
tanjinzhou 2019-08-28 10:50:19 +08:00
parent d459b20b20
commit c9f1c26693
64 changed files with 145 additions and 15 deletions

View File

@ -1,5 +1,6 @@
import Vue from 'vue'; import Vue from 'vue';
import PropTypes from './vue-types'; import PropTypes from './vue-types';
import Base from '../base';
export default { export default {
props: { props: {
@ -51,9 +52,9 @@ export default {
this.componentEl = el; this.componentEl = el;
this.container.appendChild(el); this.container.appendChild(el);
} }
if (!this._component) { if (!this._component) {
this._component = new Vue({ const V = Base.Vue || Vue;
this._component = new V({
el: el, el: el,
parent: self.parent, parent: self.parent,
data: { data: {

View File

@ -1,8 +1,10 @@
import ref from 'vue-ref';
import { antInput } from './antInputDirective'; import { antInput } from './antInputDirective';
import { antDecorator } from './FormDecoratorDirective'; import { antDecorator } from './FormDecoratorDirective';
export default { export default {
install: Vue => { install: Vue => {
Vue.use(ref, { name: 'ant-ref' });
antInput(Vue); antInput(Vue);
antDecorator(Vue); antDecorator(Vue);
}, },

View File

@ -6,6 +6,7 @@ import omit from 'omit.js';
import getScroll from '../_util/getScroll'; import getScroll from '../_util/getScroll';
import BaseMixin from '../_util/BaseMixin'; import BaseMixin from '../_util/BaseMixin';
import throttleByAnimationFrame from '../_util/throttleByAnimationFrame'; import throttleByAnimationFrame from '../_util/throttleByAnimationFrame';
import Base from '../base';
function getTargetRect(target) { function getTargetRect(target) {
return target !== window ? target.getBoundingClientRect() : { top: 0, left: 0, bottom: 0 }; return target !== window ? target.getBoundingClientRect() : { top: 0, left: 0, bottom: 0 };
@ -259,6 +260,7 @@ const Affix = {
/* istanbul ignore next */ /* istanbul ignore next */
Affix.install = function(Vue) { Affix.install = function(Vue) {
Vue.use(Base);
Vue.component(Affix.name, Affix); Vue.component(Affix.name, Affix);
}; };

View File

@ -5,6 +5,7 @@ import PropTypes from '../_util/vue-types';
import getTransitionProps from '../_util/getTransitionProps'; import getTransitionProps from '../_util/getTransitionProps';
import { getComponentFromProp, isValidElement } from '../_util/props-util'; import { getComponentFromProp, isValidElement } from '../_util/props-util';
import { cloneElement } from '../_util/vnode'; import { cloneElement } from '../_util/vnode';
import Base from '../base';
function noop() {} function noop() {}
export const AlertProps = { export const AlertProps = {
/** /**
@ -150,6 +151,7 @@ const Alert = {
/* istanbul ignore next */ /* istanbul ignore next */
Alert.install = function(Vue) { Alert.install = function(Vue) {
Vue.use(Base);
Vue.component(Alert.name, Alert); Vue.component(Alert.name, Alert);
}; };

View File

@ -1,15 +1,15 @@
import Anchor from './Anchor'; import Anchor from './Anchor';
import AnchorLink from './AnchorLink'; import AnchorLink from './AnchorLink';
import Base from '../base';
export { AnchorProps } from './Anchor';
export { AnchorLinkProps } from './AnchorLink';
Anchor.Link = AnchorLink; Anchor.Link = AnchorLink;
/* istanbul ignore next */ /* istanbul ignore next */
Anchor.install = function(Vue) { Anchor.install = function(Vue) {
Vue.use(Base);
Vue.component(Anchor.name, Anchor); Vue.component(Anchor.name, Anchor);
Vue.component(Anchor.Link.name, Anchor.Link); Vue.component(Anchor.Link.name, Anchor.Link);
}; };
export { AnchorProps } from './Anchor';
export { AnchorLinkProps } from './AnchorLink';
export default Anchor; export default Anchor;

View File

@ -9,6 +9,7 @@ import {
filterEmpty, filterEmpty,
isValidElement, isValidElement,
} from '../_util/props-util'; } from '../_util/props-util';
import Base from '../base';
// const DataSourceItemObject = PropTypes.shape({ // const DataSourceItemObject = PropTypes.shape({
// value: String, // value: String,
@ -135,6 +136,7 @@ const AutoComplete = {
/* istanbul ignore next */ /* istanbul ignore next */
AutoComplete.install = function(Vue) { AutoComplete.install = function(Vue) {
Vue.use(Base);
Vue.component(AutoComplete.name, AutoComplete); Vue.component(AutoComplete.name, AutoComplete);
Vue.component(AutoComplete.Option.name, AutoComplete.Option); Vue.component(AutoComplete.Option.name, AutoComplete.Option);
Vue.component(AutoComplete.OptGroup.name, AutoComplete.OptGroup); Vue.component(AutoComplete.OptGroup.name, AutoComplete.OptGroup);

View File

@ -1,7 +1,9 @@
import Avatar from './Avatar'; import Avatar from './Avatar';
import Base from '../base';
/* istanbul ignore next */ /* istanbul ignore next */
Avatar.install = function(Vue) { Avatar.install = function(Vue) {
Vue.use(Base);
Vue.component(Avatar.name, Avatar); Vue.component(Avatar.name, Avatar);
}; };

View File

@ -4,6 +4,7 @@ import addEventListener from '../_util/Dom/addEventListener';
import getScroll from '../_util/getScroll'; import getScroll from '../_util/getScroll';
import BaseMixin from '../_util/BaseMixin'; import BaseMixin from '../_util/BaseMixin';
import getTransitionProps from '../_util/getTransitionProps'; import getTransitionProps from '../_util/getTransitionProps';
import Base from '../base';
const easeInOutCubic = (t, b, c, d) => { const easeInOutCubic = (t, b, c, d) => {
const cc = c - b; const cc = c - b;
@ -126,6 +127,7 @@ const BackTop = {
/* istanbul ignore next */ /* istanbul ignore next */
BackTop.install = function(Vue) { BackTop.install = function(Vue) {
Vue.use(Base);
Vue.component(BackTop.name, BackTop); Vue.component(BackTop.name, BackTop);
}; };

View File

@ -1,7 +1,9 @@
import Badge from './Badge'; import Badge from './Badge';
import Base from '../base';
/* istanbul ignore next */ /* istanbul ignore next */
Badge.install = function(Vue) { Badge.install = function(Vue) {
Vue.use(Base);
Vue.component(Badge.name, Badge); Vue.component(Badge.name, Badge);
}; };

9
components/base/index.js Normal file
View File

@ -0,0 +1,9 @@
import antDirective from '../_util/antDirective';
const base = {};
const install = function(Vue) {
base.Vue = Vue;
Vue.use(antDirective);
};
base.install = install;
export default base;

View File

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

View File

@ -1,10 +1,12 @@
import Breadcrumb from './Breadcrumb'; import Breadcrumb from './Breadcrumb';
import BreadcrumbItem from './BreadcrumbItem'; import BreadcrumbItem from './BreadcrumbItem';
import Base from '../base';
Breadcrumb.Item = BreadcrumbItem; Breadcrumb.Item = BreadcrumbItem;
/* istanbul ignore next */ /* istanbul ignore next */
Breadcrumb.install = function(Vue) { Breadcrumb.install = function(Vue) {
Vue.use(Base);
Vue.component(Breadcrumb.name, Breadcrumb); Vue.component(Breadcrumb.name, Breadcrumb);
Vue.component(BreadcrumbItem.name, BreadcrumbItem); Vue.component(BreadcrumbItem.name, BreadcrumbItem);
}; };

View File

@ -1,10 +1,12 @@
import Button from './button'; import Button from './button';
import ButtonGroup from './button-group'; import ButtonGroup from './button-group';
import Base from '../base';
Button.Group = ButtonGroup; Button.Group = ButtonGroup;
/* istanbul ignore next */ /* istanbul ignore next */
Button.install = function(Vue) { Button.install = function(Vue) {
Vue.use(Base);
Vue.component(Button.name, Button); Vue.component(Button.name, Button);
Vue.component(ButtonGroup.name, ButtonGroup); Vue.component(ButtonGroup.name, ButtonGroup);
}; };

View File

@ -8,8 +8,7 @@ import { PREFIX_CLS } from './Constants';
import Header from './Header'; import Header from './Header';
import interopDefault from '../_util/interopDefault'; import interopDefault from '../_util/interopDefault';
import enUS from './locale/en_US'; import enUS from './locale/en_US';
import Base from '../base';
export { HeaderProps } from './Header';
function noop() { function noop() {
return null; return null;
@ -242,7 +241,8 @@ const Calendar = {
/* istanbul ignore next */ /* istanbul ignore next */
Calendar.install = function(Vue) { Calendar.install = function(Vue) {
Vue.use(Base);
Vue.component(Calendar.name, Calendar); Vue.component(Calendar.name, Calendar);
}; };
export { HeaderProps } from './Header';
export default Calendar; export default Calendar;

View File

@ -1,11 +1,13 @@
import Card from './Card'; import Card from './Card';
import Meta from './Meta'; import Meta from './Meta';
import Grid from './Grid'; import Grid from './Grid';
import Base from '../base';
Card.Meta = Meta; Card.Meta = Meta;
Card.Grid = Grid; Card.Grid = Grid;
/* istanbul ignore next */ /* istanbul ignore next */
Card.install = function(Vue) { Card.install = function(Vue) {
Vue.use(Base);
Vue.component(Card.name, Card); Vue.component(Card.name, Card);
Vue.component(Meta.name, Meta); Vue.component(Meta.name, Meta);
Vue.component(Grid.name, Grid); Vue.component(Grid.name, Grid);

View File

@ -1,6 +1,7 @@
import PropTypes from '../_util/vue-types'; import PropTypes from '../_util/vue-types';
import debounce from 'lodash/debounce'; import debounce from 'lodash/debounce';
import { initDefaultProps, getComponentFromProp, filterEmpty } from '../_util/props-util'; import { initDefaultProps, getComponentFromProp, filterEmpty } from '../_util/props-util';
import Base from '../base';
// matchMedia polyfill for // matchMedia polyfill for
// https://github.com/WickyNilliams/enquire.js/issues/82 // https://github.com/WickyNilliams/enquire.js/issues/82
@ -163,6 +164,7 @@ const Carousel = {
/* istanbul ignore next */ /* istanbul ignore next */
Carousel.install = function(Vue) { Carousel.install = function(Vue) {
Vue.use(Base);
Vue.component(Carousel.name, Carousel); Vue.component(Carousel.name, Carousel);
}; };

View File

@ -19,6 +19,7 @@ import {
import BaseMixin from '../_util/BaseMixin'; import BaseMixin from '../_util/BaseMixin';
import { cloneElement } from '../_util/vnode'; import { cloneElement } from '../_util/vnode';
import warning from '../_util/warning'; import warning from '../_util/warning';
import Base from '../base';
const CascaderOptionType = PropTypes.shape({ const CascaderOptionType = PropTypes.shape({
value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
@ -528,6 +529,7 @@ const Cascader = {
/* istanbul ignore next */ /* istanbul ignore next */
Cascader.install = function(Vue) { Cascader.install = function(Vue) {
Vue.use(Base);
Vue.component(Cascader.name, Cascader); Vue.component(Cascader.name, Cascader);
}; };

View File

@ -1,10 +1,12 @@
import Checkbox from './Checkbox'; import Checkbox from './Checkbox';
import CheckboxGroup from './Group'; import CheckboxGroup from './Group';
import Base from '../base';
Checkbox.Group = CheckboxGroup; Checkbox.Group = CheckboxGroup;
/* istanbul ignore next */ /* istanbul ignore next */
Checkbox.install = function(Vue) { Checkbox.install = function(Vue) {
Vue.use(Base);
Vue.component(Checkbox.name, Checkbox); Vue.component(Checkbox.name, Checkbox);
Vue.component(CheckboxGroup.name, CheckboxGroup); Vue.component(CheckboxGroup.name, CheckboxGroup);
}; };

View File

@ -1,6 +1,8 @@
import { Col } from '../grid'; import { Col } from '../grid';
import Base from '../base';
/* istanbul ignore next */ /* istanbul ignore next */
Col.install = function(Vue) { Col.install = function(Vue) {
Vue.use(Base);
Vue.component(Col.name, Col); Vue.component(Col.name, Col);
}; };

View File

@ -1,10 +1,12 @@
import Collapse from './Collapse'; import Collapse from './Collapse';
import CollapsePanel from './CollapsePanel'; import CollapsePanel from './CollapsePanel';
import Base from '../base';
Collapse.Panel = CollapsePanel; Collapse.Panel = CollapsePanel;
/* istanbul ignore next */ /* istanbul ignore next */
Collapse.install = function(Vue) { Collapse.install = function(Vue) {
Vue.use(Base);
Vue.component(Collapse.name, Collapse); Vue.component(Collapse.name, Collapse);
Vue.component(CollapsePanel.name, CollapsePanel); Vue.component(CollapsePanel.name, CollapsePanel);
}; };

View File

@ -1,6 +1,6 @@
import PropsTypes from '../_util/vue-types'; import PropsTypes from '../_util/vue-types';
import { initDefaultProps, getComponentFromProp } from '../_util/props-util'; import { initDefaultProps, getComponentFromProp } from '../_util/props-util';
import Base from '../base';
export const CommentProps = { export const CommentProps = {
actions: PropsTypes.array, actions: PropsTypes.array,
/** The element to display as the comment author. */ /** The element to display as the comment author. */
@ -88,6 +88,7 @@ const Comment = {
/* istanbul ignore next */ /* istanbul ignore next */
Comment.install = function(Vue) { Comment.install = function(Vue) {
Vue.use(Base);
Vue.component(Comment.name, Comment); Vue.component(Comment.name, Comment);
}; };
export default Comment; export default Comment;

View File

@ -1,4 +1,5 @@
import PropTypes from '../_util/vue-types'; import PropTypes from '../_util/vue-types';
import Base from '../base';
const ConfigProvider = { const ConfigProvider = {
name: 'AConfigProvider', name: 'AConfigProvider',
@ -17,6 +18,7 @@ const ConfigProvider = {
/* istanbul ignore next */ /* istanbul ignore next */
ConfigProvider.install = function(Vue) { ConfigProvider.install = function(Vue) {
Vue.use(Base);
Vue.component(ConfigProvider.name, ConfigProvider); Vue.component(ConfigProvider.name, ConfigProvider);
}; };

View File

@ -5,6 +5,7 @@ import wrapPicker from './wrapPicker';
import RangePicker from './RangePicker'; import RangePicker from './RangePicker';
import WeekPicker from './WeekPicker'; import WeekPicker from './WeekPicker';
import { DatePickerProps, MonthPickerProps, WeekPickerProps, RangePickerProps } from './interface'; import { DatePickerProps, MonthPickerProps, WeekPickerProps, RangePickerProps } from './interface';
import Base from '../base';
const DatePicker = wrapPicker( const DatePicker = wrapPicker(
{ ...createPicker(VcCalendar, DatePickerProps()), name: 'ADatePicker' }, { ...createPicker(VcCalendar, DatePickerProps()), name: 'ADatePicker' },
@ -25,6 +26,7 @@ Object.assign(DatePicker, {
/* istanbul ignore next */ /* istanbul ignore next */
DatePicker.install = function(Vue) { DatePicker.install = function(Vue) {
Vue.use(Base);
Vue.component(DatePicker.name, DatePicker); Vue.component(DatePicker.name, DatePicker);
Vue.component(DatePicker.RangePicker.name, DatePicker.RangePicker); Vue.component(DatePicker.RangePicker.name, DatePicker.RangePicker);
Vue.component(DatePicker.MonthPicker.name, DatePicker.MonthPicker); Vue.component(DatePicker.MonthPicker.name, DatePicker.MonthPicker);

View File

@ -1,4 +1,5 @@
import PropTypes from '../_util/vue-types'; import PropTypes from '../_util/vue-types';
import Base from '../base';
const Divider = { const Divider = {
name: 'ADivider', name: 'ADivider',
props: { props: {
@ -32,6 +33,7 @@ const Divider = {
/* istanbul ignore next */ /* istanbul ignore next */
Divider.install = function(Vue) { Divider.install = function(Vue) {
Vue.use(Base);
Vue.component(Divider.name, Divider); Vue.component(Divider.name, Divider);
}; };

View File

@ -4,6 +4,7 @@ import PropTypes from '../_util/vue-types';
import BaseMixin from '../_util/BaseMixin'; import BaseMixin from '../_util/BaseMixin';
import Icon from '../icon'; import Icon from '../icon';
import { getComponentFromProp, getOptionProps } from '../_util/props-util'; import { getComponentFromProp, getOptionProps } from '../_util/props-util';
import Base from '../base';
const Drawer = { const Drawer = {
name: 'ADrawer', name: 'ADrawer',
@ -208,6 +209,7 @@ const Drawer = {
/* istanbul ignore next */ /* istanbul ignore next */
Drawer.install = function(Vue) { Drawer.install = function(Vue) {
Vue.use(Base);
Vue.component(Drawer.name, Drawer); Vue.component(Drawer.name, Drawer);
}; };

View File

@ -3,11 +3,13 @@ import DropdownButton from './dropdown-button';
export { DropdownProps } from './dropdown'; export { DropdownProps } from './dropdown';
export { DropdownButtonProps } from './dropdown-button'; export { DropdownButtonProps } from './dropdown-button';
import Base from '../base';
Dropdown.Button = DropdownButton; Dropdown.Button = DropdownButton;
/* istanbul ignore next */ /* istanbul ignore next */
Dropdown.install = function(Vue) { Dropdown.install = function(Vue) {
Vue.use(Base);
Vue.component(Dropdown.name, Dropdown); Vue.component(Dropdown.name, Dropdown);
Vue.component(DropdownButton.name, DropdownButton); Vue.component(DropdownButton.name, DropdownButton);
}; };

View File

@ -8,6 +8,7 @@ import createFormField from '../vc-form/src/createFormField';
import FormItem from './FormItem'; import FormItem from './FormItem';
import { FIELD_META_PROP, FIELD_DATA_PROP } from './constants'; import { FIELD_META_PROP, FIELD_DATA_PROP } from './constants';
import { initDefaultProps } from '../_util/props-util'; import { initDefaultProps } from '../_util/props-util';
import Base from '../base';
export const FormCreateOption = { export const FormCreateOption = {
onFieldsChange: PropTypes.func, onFieldsChange: PropTypes.func,
@ -137,7 +138,8 @@ const Form = {
}); });
}, },
createForm(context, options = {}) { createForm(context, options = {}) {
return new Vue(Form.create({ ...options, templateContext: context })()); const V = Base.Vue || Vue;
return new V(Form.create({ ...options, templateContext: context })());
}, },
created() { created() {
this.formItemContexts = new Map(); this.formItemContexts = new Map();

View File

@ -2,6 +2,7 @@ import Vue from 'vue';
import Form from './Form'; import Form from './Form';
import ref from 'vue-ref'; import ref from 'vue-ref';
import FormDecoratorDirective from '../_util/FormDecoratorDirective'; import FormDecoratorDirective from '../_util/FormDecoratorDirective';
import Base from '../base';
Vue.use(ref, { name: 'ant-ref' }); Vue.use(ref, { name: 'ant-ref' });
Vue.use(FormDecoratorDirective); Vue.use(FormDecoratorDirective);
@ -12,6 +13,7 @@ export { FormItemProps } from './FormItem';
/* istanbul ignore next */ /* istanbul ignore next */
Form.install = function(Vue) { Form.install = function(Vue) {
Vue.use(Base);
Vue.component(Form.name, Form); Vue.component(Form.name, Form);
Vue.component(Form.Item.name, Form.Item); Vue.component(Form.Item.name, Form.Item);
Vue.prototype.$form = Form; Vue.prototype.$form = Form;

View File

@ -13,6 +13,7 @@ import {
import warning from '../_util/warning'; import warning from '../_util/warning';
import { getTwoToneColor, setTwoToneColor } from './twoTonePrimaryColor'; import { getTwoToneColor, setTwoToneColor } from './twoTonePrimaryColor';
import { filterEmpty, getClass } from '../_util/props-util'; import { filterEmpty, getClass } from '../_util/props-util';
import Base from '../base';
// Initial setting // Initial setting
VueIcon.add(...Object.keys(allIcons).map(key => allIcons[key])); VueIcon.add(...Object.keys(allIcons).map(key => allIcons[key]));
@ -137,6 +138,7 @@ Icon.setTwoToneColor = setTwoToneColor;
/* istanbul ignore next */ /* istanbul ignore next */
Icon.install = function(Vue) { Icon.install = function(Vue) {
Vue.use(Base);
Vue.component(Icon.name, Icon); Vue.component(Icon.name, Icon);
}; };

View File

@ -29,6 +29,8 @@ import { default as BackTop } from './back-top';
import { default as Badge } from './badge'; import { default as Badge } from './badge';
import { default as Base } from './base';
import { default as Breadcrumb } from './breadcrumb'; import { default as Breadcrumb } from './breadcrumb';
import { default as Button } from './button'; import { default as Button } from './button';
@ -132,6 +134,7 @@ import { default as Comment } from './comment';
import { default as ConfigProvider } from './config-provider'; import { default as ConfigProvider } from './config-provider';
const components = [ const components = [
Base,
Affix, Affix,
Anchor, Anchor,
AutoComplete, AutoComplete,
@ -208,6 +211,7 @@ if (typeof window !== 'undefined' && window.Vue) {
} }
export { export {
Base,
version, version,
install, install,
message, message,

View File

@ -3,6 +3,7 @@ import { initDefaultProps, getOptionProps } from '../_util/props-util';
import classNames from 'classnames'; import classNames from 'classnames';
import Icon from '../icon'; import Icon from '../icon';
import VcInputNumber from '../vc-input-number/src'; import VcInputNumber from '../vc-input-number/src';
import Base from '../base';
export const InputNumberProps = { export const InputNumberProps = {
prefixCls: PropTypes.string, prefixCls: PropTypes.string,
@ -68,6 +69,7 @@ const InputNumber = {
/* istanbul ignore next */ /* istanbul ignore next */
InputNumber.install = function(Vue) { InputNumber.install = function(Vue) {
Vue.use(Base);
Vue.component(InputNumber.name, InputNumber); Vue.component(InputNumber.name, InputNumber);
}; };

View File

@ -4,6 +4,7 @@ import Group from './Group';
import Search from './Search'; import Search from './Search';
import TextArea from './TextArea'; import TextArea from './TextArea';
import antInputDirective from '../_util/antInputDirective'; import antInputDirective from '../_util/antInputDirective';
import Base from '../base';
Vue.use(antInputDirective); Vue.use(antInputDirective);
@ -13,6 +14,7 @@ Input.TextArea = TextArea;
/* istanbul ignore next */ /* istanbul ignore next */
Input.install = function(Vue) { Input.install = function(Vue) {
Vue.use(Base);
Vue.component(Input.name, Input); Vue.component(Input.name, Input);
Vue.component(Input.Group.name, Input.Group); Vue.component(Input.Group.name, Input.Group);
Vue.component(Input.Search.name, Input.Search); Vue.component(Input.Search.name, Input.Search);

View File

@ -1,10 +1,12 @@
import Layout from './layout'; import Layout from './layout';
import Sider from './Sider'; import Sider from './Sider';
import Base from '../base';
Layout.Sider = Sider; Layout.Sider = Sider;
/* istanbul ignore next */ /* istanbul ignore next */
Layout.install = function(Vue) { Layout.install = function(Vue) {
Vue.use(Base);
Vue.component(Layout.name, Layout); Vue.component(Layout.name, Layout);
Vue.component(Layout.Header.name, Layout.Header); Vue.component(Layout.Header.name, Layout.Header);
Vue.component(Layout.Footer.name, Layout.Footer); Vue.component(Layout.Footer.name, Layout.Footer);

View File

@ -11,6 +11,7 @@ import { Row } from '../grid';
import Item from './Item'; import Item from './Item';
import { initDefaultProps, getComponentFromProp, filterEmpty } from '../_util/props-util'; import { initDefaultProps, getComponentFromProp, filterEmpty } from '../_util/props-util';
import { cloneElement } from '../_util/vnode'; import { cloneElement } from '../_util/vnode';
import Base from '../base';
export { ListItemProps, ListItemMetaProps } from './Item'; export { ListItemProps, ListItemMetaProps } from './Item';
@ -242,6 +243,7 @@ const List = {
/* istanbul ignore next */ /* istanbul ignore next */
List.install = function(Vue) { List.install = function(Vue) {
Vue.use(Base);
Vue.component(List.name, List); Vue.component(List.name, List);
Vue.component(List.Item.name, List.Item); Vue.component(List.Item.name, List.Item);
Vue.component(List.Item.Meta.name, List.Item.Meta); Vue.component(List.Item.Meta.name, List.Item.Meta);

View File

@ -2,7 +2,7 @@ import PropTypes from '../_util/vue-types';
import * as moment from 'moment'; import * as moment from 'moment';
import interopDefault from '../_util/interopDefault'; import interopDefault from '../_util/interopDefault';
import { changeConfirmLocale } from '../modal/locale'; import { changeConfirmLocale } from '../modal/locale';
import Base from '../base';
// export interface Locale { // export interface Locale {
// locale: string; // locale: string;
// Pagination?: Object; // Pagination?: Object;
@ -71,6 +71,7 @@ const LocaleProvider = {
/* istanbul ignore next */ /* istanbul ignore next */
LocaleProvider.install = function(Vue) { LocaleProvider.install = function(Vue) {
Vue.use(Base);
Vue.component(LocaleProvider.name, LocaleProvider); Vue.component(LocaleProvider.name, LocaleProvider);
}; };

View File

@ -7,6 +7,7 @@ import Item from './MenuItem';
import { hasProp } from '../_util/props-util'; import { hasProp } from '../_util/props-util';
import BaseMixin from '../_util/BaseMixin'; import BaseMixin from '../_util/BaseMixin';
import commonPropsType from '../vc-menu/commonPropsType'; import commonPropsType from '../vc-menu/commonPropsType';
import Base from '../base';
export const MenuMode = PropTypes.oneOf([ export const MenuMode = PropTypes.oneOf([
'vertical', 'vertical',
@ -266,6 +267,7 @@ const Menu = {
/* istanbul ignore next */ /* istanbul ignore next */
Menu.install = function(Vue) { Menu.install = function(Vue) {
Vue.use(Base);
Vue.component(Menu.name, Menu); Vue.component(Menu.name, Menu);
Vue.component(Menu.Item.name, Menu.Item); Vue.component(Menu.Item.name, Menu.Item);
Vue.component(Menu.SubMenu.name, Menu.SubMenu); Vue.component(Menu.SubMenu.name, Menu.SubMenu);

View File

@ -1,5 +1,6 @@
import Vue from 'vue'; import Vue from 'vue';
import ConfirmDialog from './ConfirmDialog'; import ConfirmDialog from './ConfirmDialog';
import Base from '../base';
export default function confirm(config) { export default function confirm(config) {
const div = document.createElement('div'); const div = document.createElement('div');
@ -34,7 +35,8 @@ export default function confirm(config) {
function render(props) { function render(props) {
confirmDialogProps.props = props; confirmDialogProps.props = props;
return new Vue({ const V = Base.Vue || Vue;
return new V({
el: el, el: el,
data() { data() {
return { confirmDialogProps }; return { confirmDialogProps };

View File

@ -1,5 +1,6 @@
import Modal from './Modal'; import Modal from './Modal';
import modalConfirm from './confirm'; import modalConfirm from './confirm';
import Base from '../base';
// export { ActionButtonProps } from './ActionButton' // export { ActionButtonProps } from './ActionButton'
// export { ModalProps, ModalFuncProps } from './Modal' // export { ModalProps, ModalFuncProps } from './Modal'
@ -62,6 +63,7 @@ Modal.confirm = confirm;
/* istanbul ignore next */ /* istanbul ignore next */
Modal.install = function(Vue) { Modal.install = function(Vue) {
Vue.use(Base);
Vue.component(Modal.name, Modal); Vue.component(Modal.name, Modal);
}; };

View File

@ -1,9 +1,11 @@
import Pagination from './Pagination'; import Pagination from './Pagination';
import Base from '../base';
export { PaginationProps, PaginationConfig } from './Pagination'; export { PaginationProps, PaginationConfig } from './Pagination';
/* istanbul ignore next */ /* istanbul ignore next */
Pagination.install = function(Vue) { Pagination.install = function(Vue) {
Vue.use(Base);
Vue.component(Pagination.name, Pagination); Vue.component(Pagination.name, Pagination);
}; };

View File

@ -9,6 +9,7 @@ import Icon from '../icon';
import Button from '../button'; import Button from '../button';
import LocaleReceiver from '../locale-provider/LocaleReceiver'; import LocaleReceiver from '../locale-provider/LocaleReceiver';
import defaultLocale from '../locale-provider/default'; import defaultLocale from '../locale-provider/default';
import Base from '../base';
const tooltipProps = abstractTooltipProps(); const tooltipProps = abstractTooltipProps();
const btnProps = buttonTypes(); const btnProps = buttonTypes();
@ -149,6 +150,7 @@ const Popconfirm = {
/* istanbul ignore next */ /* istanbul ignore next */
Popconfirm.install = function(Vue) { Popconfirm.install = function(Vue) {
Vue.use(Base);
Vue.component(Popconfirm.name, Popconfirm); Vue.component(Popconfirm.name, Popconfirm);
}; };

View File

@ -2,6 +2,7 @@ import Tooltip from '../tooltip';
import abstractTooltipProps from '../tooltip/abstractTooltipProps'; import abstractTooltipProps from '../tooltip/abstractTooltipProps';
import PropTypes from '../_util/vue-types'; import PropTypes from '../_util/vue-types';
import { getOptionProps, getComponentFromProp } from '../_util/props-util'; import { getOptionProps, getComponentFromProp } from '../_util/props-util';
import Base from '../base';
const props = abstractTooltipProps(); const props = abstractTooltipProps();
const Popover = { const Popover = {
@ -53,6 +54,7 @@ const Popover = {
/* istanbul ignore next */ /* istanbul ignore next */
Popover.install = function(Vue) { Popover.install = function(Vue) {
Vue.use(Base);
Vue.component(Popover.name, Popover); Vue.component(Popover.name, Popover);
}; };

View File

@ -1,9 +1,11 @@
import Progress from './progress'; import Progress from './progress';
import Base from '../base';
export { ProgressProps } from './progress'; export { ProgressProps } from './progress';
/* istanbul ignore next */ /* istanbul ignore next */
Progress.install = function(Vue) { Progress.install = function(Vue) {
Vue.use(Base);
Vue.component(Progress.name, Progress); Vue.component(Progress.name, Progress);
}; };

View File

@ -1,12 +1,14 @@
import Radio from './Radio'; import Radio from './Radio';
import Group from './Group'; import Group from './Group';
import Button from './RadioButton'; import Button from './RadioButton';
import Base from '../base';
Radio.Group = Group; Radio.Group = Group;
Radio.Button = Button; Radio.Button = Button;
/* istanbul ignore next */ /* istanbul ignore next */
Radio.install = function(Vue) { Radio.install = function(Vue) {
Vue.use(Base);
Vue.component(Radio.name, Radio); Vue.component(Radio.name, Radio);
Vue.component(Radio.Group.name, Radio.Group); Vue.component(Radio.Group.name, Radio.Group);
Vue.component(Radio.Button.name, Radio.Button); Vue.component(Radio.Button.name, Radio.Button);

View File

@ -2,6 +2,7 @@ import PropTypes from '../_util/vue-types';
import { initDefaultProps, getOptionProps, getComponentFromProp } from '../_util/props-util'; import { initDefaultProps, getOptionProps, getComponentFromProp } from '../_util/props-util';
import VcRate from '../vc-rate'; import VcRate from '../vc-rate';
import Icon from '../icon'; import Icon from '../icon';
import Base from '../base';
export const RateProps = { export const RateProps = {
prefixCls: PropTypes.string, prefixCls: PropTypes.string,
@ -50,6 +51,7 @@ const Rate = {
/* istanbul ignore next */ /* istanbul ignore next */
Rate.install = function(Vue) { Rate.install = function(Vue) {
Vue.use(Base);
Vue.component(Rate.name, Rate); Vue.component(Rate.name, Rate);
}; };
export default Rate; export default Rate;

View File

@ -1,7 +1,9 @@
import { Row } from '../grid'; import { Row } from '../grid';
import Base from '../base';
/* istanbul ignore next */ /* istanbul ignore next */
Row.install = function(Vue) { Row.install = function(Vue) {
Vue.use(Base);
Vue.component(Row.name, Row); Vue.component(Row.name, Row);
}; };

View File

@ -12,6 +12,7 @@ import {
} from '../_util/props-util'; } from '../_util/props-util';
import Icon from '../icon'; import Icon from '../icon';
import { cloneElement } from '../_util/vnode'; import { cloneElement } from '../_util/vnode';
import Base from '../base';
const AbstractSelectProps = () => ({ const AbstractSelectProps = () => ({
prefixCls: PropTypes.string, prefixCls: PropTypes.string,
@ -261,6 +262,7 @@ const Select = {
/* istanbul ignore next */ /* istanbul ignore next */
Select.install = function(Vue) { Select.install = function(Vue) {
Vue.use(Base);
Vue.component(Select.name, Select); Vue.component(Select.name, Select);
Vue.component(Select.Option.name, Select.Option); Vue.component(Select.Option.name, Select.Option);
Vue.component(Select.OptGroup.name, Select.OptGroup); Vue.component(Select.OptGroup.name, Select.OptGroup);

View File

@ -4,6 +4,7 @@ import { initDefaultProps, hasProp } from '../_util/props-util';
import Avatar, { SkeletonAvatarProps } from './Avatar'; import Avatar, { SkeletonAvatarProps } from './Avatar';
import Title, { SkeletonTitleProps } from './Title'; import Title, { SkeletonTitleProps } from './Title';
import Paragraph, { SkeletonParagraphProps } from './Paragraph'; import Paragraph, { SkeletonParagraphProps } from './Paragraph';
import Base from '../base';
export const SkeletonProps = { export const SkeletonProps = {
active: PropTypes.bool, active: PropTypes.bool,
@ -145,6 +146,7 @@ const Skeleton = {
}; };
/* istanbul ignore next */ /* istanbul ignore next */
Skeleton.install = function(Vue) { Skeleton.install = function(Vue) {
Vue.use(Base);
Vue.component(Skeleton.name, Skeleton); Vue.component(Skeleton.name, Skeleton);
}; };
export default Skeleton; export default Skeleton;

View File

@ -5,6 +5,7 @@ import VcSlider from '../vc-slider/src/Slider';
import VcRange from '../vc-slider/src/Range'; import VcRange from '../vc-slider/src/Range';
import VcHandle from '../vc-slider/src/Handle'; import VcHandle from '../vc-slider/src/Handle';
import Tooltip from '../tooltip'; import Tooltip from '../tooltip';
import Base from '../base';
// export interface SliderMarks { // export interface SliderMarks {
// [key]: React.ReactNode | { // [key]: React.ReactNode | {
@ -131,6 +132,7 @@ const Slider = {
/* istanbul ignore next */ /* istanbul ignore next */
Slider.install = function(Vue) { Slider.install = function(Vue) {
Vue.use(Base);
Vue.component(Slider.name, Slider); Vue.component(Slider.name, Slider);
}; };

View File

@ -1,4 +1,5 @@
import Spin, { setDefaultIndicator } from './Spin'; import Spin, { setDefaultIndicator } from './Spin';
import Base from '../base';
export { SpinProps } from './Spin'; export { SpinProps } from './Spin';
@ -6,6 +7,7 @@ Spin.setDefaultIndicator = setDefaultIndicator;
/* istanbul ignore next */ /* istanbul ignore next */
Spin.install = function(Vue) { Spin.install = function(Vue) {
Vue.use(Base);
Vue.component(Spin.name, Spin); Vue.component(Spin.name, Spin);
}; };

View File

@ -2,6 +2,7 @@ import PropTypes from '../_util/vue-types';
import { initDefaultProps, getOptionProps } from '../_util/props-util'; import { initDefaultProps, getOptionProps } from '../_util/props-util';
import VcSteps from '../vc-steps'; import VcSteps from '../vc-steps';
import Icon from '../icon'; import Icon from '../icon';
import Base from '../base';
const getStepsProps = (defaultProps = {}) => { const getStepsProps = (defaultProps = {}) => {
const props = { const props = {
@ -47,6 +48,7 @@ const Steps = {
/* istanbul ignore next */ /* istanbul ignore next */
Steps.install = function(Vue) { Steps.install = function(Vue) {
Vue.use(Base);
Vue.component(Steps.name, Steps); Vue.component(Steps.name, Steps);
Vue.component(Steps.Step.name, Steps.Step); Vue.component(Steps.Step.name, Steps.Step);
}; };

View File

@ -3,6 +3,7 @@ import { getOptionProps, getComponentFromProp } from '../_util/props-util';
import VcSwitch from '../vc-switch'; import VcSwitch from '../vc-switch';
import Wave from '../_util/wave'; import Wave from '../_util/wave';
import Icon from '../icon'; import Icon from '../icon';
import Base from '../base';
const Switch = { const Switch = {
name: 'ASwitch', name: 'ASwitch',
@ -64,6 +65,7 @@ const Switch = {
/* istanbul ignore next */ /* istanbul ignore next */
Switch.install = function(Vue) { Switch.install = function(Vue) {
Vue.use(Base);
Vue.component(Switch.name, Switch); Vue.component(Switch.name, Switch);
}; };

View File

@ -10,6 +10,7 @@ import {
camelize, camelize,
getSlots, getSlots,
} from '../_util/props-util'; } from '../_util/props-util';
import Base from '../base';
const Table = { const Table = {
name: 'ATable', name: 'ATable',
@ -107,6 +108,7 @@ const Table = {
}; };
/* istanbul ignore next */ /* istanbul ignore next */
Table.install = function(Vue) { Table.install = function(Vue) {
Vue.use(Base);
Vue.component(Table.name, Table); Vue.component(Table.name, Table);
Vue.component(Table.Column.name, Table.Column); Vue.component(Table.Column.name, Table.Column);
Vue.component(Table.ColumnGroup.name, Table.ColumnGroup); Vue.component(Table.ColumnGroup.name, Table.ColumnGroup);

View File

@ -3,12 +3,15 @@ import Vue from 'vue';
import Tabs from './tabs'; import Tabs from './tabs';
import TabPane from '../vc-tabs/src/TabPane'; import TabPane from '../vc-tabs/src/TabPane';
import TabContent from '../vc-tabs/src/TabContent'; import TabContent from '../vc-tabs/src/TabContent';
import Base from '../base';
Tabs.TabPane = { ...TabPane, name: 'ATabPane', __ANT_TAB_PANE: true }; Tabs.TabPane = { ...TabPane, name: 'ATabPane', __ANT_TAB_PANE: true };
Tabs.TabContent = { ...TabContent, name: 'ATabContent' }; Tabs.TabContent = { ...TabContent, name: 'ATabContent' };
Vue.use(ref, { name: 'ant-ref' }); Vue.use(ref, { name: 'ant-ref' });
/* istanbul ignore next */ /* istanbul ignore next */
Tabs.install = function(Vue) { Tabs.install = function(Vue) {
Vue.use(Base);
Vue.component(Tabs.name, Tabs); Vue.component(Tabs.name, Tabs);
Vue.component(Tabs.TabPane.name, Tabs.TabPane); Vue.component(Tabs.TabPane.name, Tabs.TabPane);
Vue.component(Tabs.TabContent.name, Tabs.TabContent); Vue.component(Tabs.TabContent.name, Tabs.TabContent);

View File

@ -1,10 +1,12 @@
import Tag from './Tag'; import Tag from './Tag';
import CheckableTag from './CheckableTag'; import CheckableTag from './CheckableTag';
import Base from '../base';
Tag.CheckableTag = CheckableTag; Tag.CheckableTag = CheckableTag;
/* istanbul ignore next */ /* istanbul ignore next */
Tag.install = function(Vue) { Tag.install = function(Vue) {
Vue.use(Base);
Vue.component(Tag.name, Tag); Vue.component(Tag.name, Tag);
Vue.component(Tag.CheckableTag.name, Tag.CheckableTag); Vue.component(Tag.CheckableTag.name, Tag.CheckableTag);
}; };

View File

@ -14,6 +14,7 @@ import {
isValidElement, isValidElement,
} from '../_util/props-util'; } from '../_util/props-util';
import { cloneElement } from '../_util/vnode'; import { cloneElement } from '../_util/vnode';
import Base from '../base';
export function generateShowHourMinuteSecond(format) { export function generateShowHourMinuteSecond(format) {
// Ref: http://momentjs.com/docs/#/parsing/string-format/ // Ref: http://momentjs.com/docs/#/parsing/string-format/
@ -215,6 +216,7 @@ const TimePicker = {
/* istanbul ignore next */ /* istanbul ignore next */
TimePicker.install = function(Vue) { TimePicker.install = function(Vue) {
Vue.use(Base);
Vue.component(TimePicker.name, TimePicker); Vue.component(TimePicker.name, TimePicker);
}; };

View File

@ -1,13 +1,15 @@
import Timeline from './Timeline'; import Timeline from './Timeline';
import TimelineItem from './TimelineItem';
import Base from '../base';
export { TimelineProps } from './Timeline'; export { TimelineProps } from './Timeline';
export { TimeLineItemProps } from './TimelineItem'; export { TimeLineItemProps } from './TimelineItem';
import TimelineItem from './TimelineItem';
Timeline.Item = TimelineItem; Timeline.Item = TimelineItem;
/* istanbul ignore next */ /* istanbul ignore next */
Timeline.install = function(Vue) { Timeline.install = function(Vue) {
Vue.use(Base);
Vue.component(Timeline.name, Timeline); Vue.component(Timeline.name, Timeline);
Vue.component(TimelineItem.name, TimelineItem); Vue.component(TimelineItem.name, TimelineItem);
}; };

View File

@ -1,7 +1,9 @@
import ToolTip from './Tooltip'; import ToolTip from './Tooltip';
import Base from '../base';
/* istanbul ignore next */ /* istanbul ignore next */
ToolTip.install = function(Vue) { ToolTip.install = function(Vue) {
Vue.use(Base);
Vue.component(ToolTip.name, ToolTip); Vue.component(ToolTip.name, ToolTip);
}; };

View File

@ -12,6 +12,7 @@ import Operation from './operation';
import LocaleReceiver from '../locale-provider/LocaleReceiver'; import LocaleReceiver from '../locale-provider/LocaleReceiver';
import defaultLocale from '../locale-provider/default'; import defaultLocale from '../locale-provider/default';
import warning from '../_util/warning'; import warning from '../_util/warning';
import Base from '../base';
export const TransferDirection = 'left' | 'right'; export const TransferDirection = 'left' | 'right';
@ -433,6 +434,7 @@ const Transfer = {
/* istanbul ignore next */ /* istanbul ignore next */
Transfer.install = function(Vue) { Transfer.install = function(Vue) {
Vue.use(Base);
Vue.component(Transfer.name, Transfer); Vue.component(Transfer.name, Transfer);
}; };

View File

@ -10,6 +10,7 @@ import {
filterEmpty, filterEmpty,
isValidElement, isValidElement,
} from '../_util/props-util'; } from '../_util/props-util';
import Base from '../base';
export { TreeData, TreeSelectProps } from './interface'; export { TreeData, TreeSelectProps } from './interface';
@ -173,6 +174,7 @@ const TreeSelect = {
/* istanbul ignore next */ /* istanbul ignore next */
TreeSelect.install = function(Vue) { TreeSelect.install = function(Vue) {
Vue.use(Base);
Vue.component(TreeSelect.name, TreeSelect); Vue.component(TreeSelect.name, TreeSelect);
Vue.component(TreeSelect.TreeNode.name, TreeSelect.TreeNode); Vue.component(TreeSelect.TreeNode.name, TreeSelect.TreeNode);
}; };

View File

@ -1,10 +1,12 @@
import Tree from './Tree'; import Tree from './Tree';
import DirectoryTree from './DirectoryTree'; import DirectoryTree from './DirectoryTree';
import Base from '../base';
Tree.TreeNode.name = 'ATreeNode'; Tree.TreeNode.name = 'ATreeNode';
Tree.DirectoryTree = DirectoryTree; Tree.DirectoryTree = DirectoryTree;
/* istanbul ignore next */ /* istanbul ignore next */
Tree.install = function(Vue) { Tree.install = function(Vue) {
Vue.use(Base);
Vue.component(Tree.name, Tree); Vue.component(Tree.name, Tree);
Vue.component(Tree.TreeNode.name, Tree.TreeNode); Vue.component(Tree.TreeNode.name, Tree.TreeNode);
Vue.component(DirectoryTree.name, DirectoryTree); Vue.component(DirectoryTree.name, DirectoryTree);

View File

@ -1,5 +1,6 @@
import Upload from './Upload'; import Upload from './Upload';
import Dragger from './Dragger'; import Dragger from './Dragger';
import Base from '../base';
export { UploadProps, UploadListProps, UploadChangeParam } from './interface'; export { UploadProps, UploadListProps, UploadChangeParam } from './interface';
@ -7,6 +8,7 @@ Upload.Dragger = Dragger;
/* istanbul ignore next */ /* istanbul ignore next */
Upload.install = function(Vue) { Upload.install = function(Vue) {
Vue.use(Base);
Vue.component(Upload.name, Upload); Vue.component(Upload.name, Upload);
Vue.component(Dragger.name, Dragger); Vue.component(Dragger.name, Dragger);
}; };

View File

@ -5,6 +5,7 @@ import BaseMixin from '../_util/BaseMixin';
import createChainedFunction from '../_util/createChainedFunction'; import createChainedFunction from '../_util/createChainedFunction';
import getTransitionProps from '../_util/getTransitionProps'; import getTransitionProps from '../_util/getTransitionProps';
import Notice from './Notice'; import Notice from './Notice';
import Base from '../base';
function noop() {} function noop() {}
@ -131,7 +132,8 @@ Notification.newInstance = function newNotificationInstance(properties, callback
} else { } else {
document.body.appendChild(div); document.body.appendChild(div);
} }
new Vue({ const V = Base.Vue || Vue;
new V({
el: div, el: div,
mounted() { mounted() {
const self = this; const self = this;

View File

@ -58,6 +58,7 @@ import {
Skeleton, Skeleton,
Comment, Comment,
ConfigProvider, ConfigProvider,
Base,
} from 'ant-design-vue'; } from 'ant-design-vue';
Vue.prototype.$message = message; Vue.prototype.$message = message;
@ -69,6 +70,7 @@ Vue.prototype.$warning = Modal.warning;
Vue.prototype.$confirm = Modal.confirm; Vue.prototype.$confirm = Modal.confirm;
/* v1.1.3+ registration methods */ /* v1.1.3+ registration methods */
Vue.use(Base);
Vue.use(Affix); Vue.use(Affix);
Vue.use(Anchor); Vue.use(Anchor);
Vue.use(AutoComplete); Vue.use(AutoComplete);

View File

@ -2,6 +2,7 @@
exports[`antd dist files exports modules correctly 1`] = ` exports[`antd dist files exports modules correctly 1`] = `
Array [ Array [
"Base",
"version", "version",
"install", "install",
"message", "message",