Blame view

src/index.js 3.75 KB
c6f21c2f   jingsam   :bug: fix ie bug
1
  // es6 polyfill
b0893113   jingsam   :art: add eslint
2
  import 'core-js/fn/array/find-index';
c6f21c2f   jingsam   :bug: fix ie bug
3
  
3735e376   jingsam   sort components
4
  import Affix from './components/affix';
9e74a856   梁灏   update webpack co...
5
6
7
8
  // import Alert from './components/alert';
  // import BackTop from './components/back-top';
  // import Badge from './components/badge';
  // import Breadcrumb from './components/breadcrumb';
d47ea998   梁灏   support Button an...
9
  import Button from './components/button';
9e74a856   梁灏   update webpack co...
10
11
12
  // import Card from './components/card';
  // import Carousel from './components/carousel';
  // import Cascader from './components/cascader';
cbe03a12   梁灏   support Checkbox
13
  import Checkbox from './components/checkbox';
9e74a856   梁灏   update webpack co...
14
15
16
17
18
  // import Circle from './components/circle';
  // import Collapse from './components/collapse';
  // import DatePicker from './components/date-picker';
  // import Dropdown from './components/dropdown';
  // import Form from './components/form';
d47ea998   梁灏   support Button an...
19
  import Icon from './components/icon';
fc7ef072   梁灏   support Input
20
  import Input from './components/input';
9e74a856   梁灏   update webpack co...
21
22
23
24
25
26
27
28
29
  // import InputNumber from './components/input-number';
  // import LoadingBar from './components/loading-bar';
  // import Menu from './components/menu';
  // import Message from './components/message';
  // import Modal from './components/modal';
  // import Notice from './components/notice';
  // import Page from './components/page';
  // import Poptip from './components/poptip';
  // import Progress from './components/progress';
06322514   梁灏   support Radio
30
  import Radio from './components/radio';
9e74a856   梁灏   update webpack co...
31
32
33
  // import Rate from './components/rate';
  // import Slider from './components/slider';
  // import Spin from './components/spin';
bd596e7a   huixisheng   support Steps
34
  import Steps from './components/steps';
9e74a856   梁灏   update webpack co...
35
36
37
38
  // import Switch from './components/switch';
  // import Table from './components/table';
  // import Tabs from './components/tabs';
  // import Tag from './components/tag';
6c9e0282   huixisheng   Support timeline
39
  import Timeline from './components/timeline';
9e74a856   梁灏   update webpack co...
40
41
42
43
44
  // import TimePicker from './components/time-picker';
  // import Tooltip from './components/tooltip';
  // import Transfer from './components/transfer';
  // import Tree from './components/tree';
  // import Upload from './components/upload';
c755733a   梁灏   support Grid
45
  import { Row, Col } from './components/grid';
9e74a856   梁灏   update webpack co...
46
  // import { Select, Option, OptionGroup } from './components/select';
d33b5143   梁灏   support i18n
47
  import locale from './locale';
7fa943eb   梁灏   init
48
49
  
  const iview = {
3735e376   jingsam   sort components
50
      Affix,
9e74a856   梁灏   update webpack co...
51
52
53
54
55
56
      // Alert,
      // BackTop,
      // Badge,
      // Breadcrumb,
      // BreadcrumbItem: Breadcrumb.Item,
      // iButton: Button,
d47ea998   梁灏   support Button an...
57
58
      Button,
      ButtonGroup: Button.Group,
9e74a856   梁灏   update webpack co...
59
60
61
62
      // Card,
      // Carousel,
      // CarouselItem: Carousel.Item,
      // Cascader,
cbe03a12   梁灏   support Checkbox
63
64
      Checkbox,
      CheckboxGroup: Checkbox.Group,
9e74a856   梁灏   update webpack co...
65
66
67
68
69
70
71
      // Circle,
      // DatePicker,
      // Dropdown,
      // DropdownItem: Dropdown.Item,
      // DropdownMenu: Dropdown.Menu,
      // iForm: Form,
      // FormItem: Form.Item,
c755733a   梁灏   support Grid
72
      iCol: Col,
9e74a856   梁灏   update webpack co...
73
      // Collapse,
d47ea998   梁灏   support Button an...
74
      Icon,
9e74a856   梁灏   update webpack co...
75
      // iInput: Input,
fc7ef072   梁灏   support Input
76
      Input,
9e74a856   梁灏   update webpack co...
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
      // InputNumber,
      // LoadingBar,
      // Menu,
      // MenuGroup: Menu.Group,
      // MenuItem: Menu.Item,
      // Submenu: Menu.Sub,
      // Message,
      // Modal,
      // Notice,
      // iOption: Option,
      // OptionGroup,
      // Page,
      // Panel: Collapse.Panel,
      // Poptip,
      // Progress,
06322514   梁灏   support Radio
92
93
      Radio,
      RadioGroup: Radio.Group,
9e74a856   梁灏   update webpack co...
94
      // Rate,
c755733a   梁灏   support Grid
95
      Row,
9e74a856   梁灏   update webpack co...
96
97
98
      // iSelect: Select,
      // Slider,
      // Spin,
bd596e7a   huixisheng   support Steps
99
100
      Step: Steps.Step,
      Steps,
9e74a856   梁灏   update webpack co...
101
102
103
104
105
      // Switch,
      // iTable: Table,
      // Tabs: Tabs,
      // TabPane: Tabs.Pane,
      // Tag,
6c9e0282   huixisheng   Support timeline
106
107
      Timeline,
      TimelineItem: Timeline.Item,
9e74a856   梁灏   update webpack co...
108
109
110
111
112
      // TimePicker,
      // Tooltip,
      // Transfer,
      // Tree,
      // Upload
7fa943eb   梁灏   init
113
114
  };
  
d33b5143   梁灏   support i18n
115
116
117
118
  const install = function (Vue, opts = {}) {
      locale.use(opts.locale);
      locale.i18n(opts.i18n);
  
343abe50   jingsam   add iview.install()
119
      Object.keys(iview).forEach((key) => {
b0893113   jingsam   :art: add eslint
120
          Vue.component(key, iview[key]);
451b52ce   梁灏   Global install iView
121
122
      });
  
9e74a856   梁灏   update webpack co...
123
124
125
126
      // Vue.prototype.$Loading = LoadingBar;
      // Vue.prototype.$Message = Message;
      // Vue.prototype.$Modal = Modal;
      // Vue.prototype.$Notice = Notice;
451b52ce   梁灏   Global install iView
127
  };
343abe50   jingsam   add iview.install()
128
129
130
131
  
  // auto install
  if (typeof window !== 'undefined' && window.Vue) {
      install(window.Vue);
451b52ce   梁灏   Global install iView
132
  }
343abe50   jingsam   add iview.install()
133
  
b0893113   jingsam   :art: add eslint
134
  module.exports = Object.assign(iview, {install});   // eslint-disable-line no-undef