Blame view

src/index.js 3.78 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
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
  // import Alert from './components/alert';
  // import BackTop from './components/back-top';
  // import Badge from './components/badge';
  // import Breadcrumb from './components/breadcrumb';
  // import Button from './components/button';
  // import Card from './components/card';
  // import Carousel from './components/carousel';
  // import Cascader from './components/cascader';
  // import Checkbox from './components/checkbox';
  // 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';
  // import Icon from './components/icon';
  // import Input from './components/input';
  // 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';
  // import Radio from './components/radio';
  // import Rate from './components/rate';
  // import Slider from './components/slider';
  // import Spin from './components/spin';
  // import Steps from './components/steps';
  // import Switch from './components/switch';
  // import Table from './components/table';
  // import Tabs from './components/tabs';
  // import Tag from './components/tag';
  // import Timeline from './components/timeline';
  // 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';
  // import { Row, Col } from './components/layout';
  // 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
      // Alert,
      // BackTop,
      // Badge,
      // Breadcrumb,
      // BreadcrumbItem: Breadcrumb.Item,
      // iButton: Button,
      // ButtonGroup: Button.Group,
      // Card,
      // Carousel,
      // CarouselItem: Carousel.Item,
      // Cascader,
      // Checkbox,
      // CheckboxGroup: Checkbox.Group,
      // Circle,
      // DatePicker,
      // Dropdown,
      // DropdownItem: Dropdown.Item,
      // DropdownMenu: Dropdown.Menu,
      // iForm: Form,
      // FormItem: Form.Item,
      // iCol: Col,
      // Collapse,
      // Icon,
      // iInput: Input,
      // InputNumber,
      // LoadingBar,
      // Menu,
      // MenuGroup: Menu.Group,
      // MenuItem: Menu.Item,
      // Submenu: Menu.Sub,
      // Message,
      // Modal,
      // Notice,
      // iOption: Option,
      // OptionGroup,
      // Page,
      // Panel: Collapse.Panel,
      // Poptip,
      // Progress,
      // Radio,
      // RadioGroup: Radio.Group,
      // Rate,
      // Row,
      // iSelect: Select,
      // Slider,
      // Spin,
      // Step: Steps.Step,
      // Steps,
      // Switch,
      // iTable: Table,
      // Tabs: Tabs,
      // TabPane: Tabs.Pane,
      // Tag,
      // Timeline,
      // TimelineItem: Timeline.Item,
      // TimePicker,
      // Tooltip,
      // Transfer,
      // Tree,
      // Upload
7fa943eb   梁灏   init
111
112
  };
  
d33b5143   梁灏   support i18n
113
114
115
116
  const install = function (Vue, opts = {}) {
      locale.use(opts.locale);
      locale.i18n(opts.i18n);
  
343abe50   jingsam   add iview.install()
117
      Object.keys(iview).forEach((key) => {
b0893113   jingsam   :art: add eslint
118
          Vue.component(key, iview[key]);
451b52ce   梁灏   Global install iView
119
120
      });
  
9e74a856   梁灏   update webpack co...
121
122
123
124
      // Vue.prototype.$Loading = LoadingBar;
      // Vue.prototype.$Message = Message;
      // Vue.prototype.$Modal = Modal;
      // Vue.prototype.$Notice = Notice;
451b52ce   梁灏   Global install iView
125
  };
343abe50   jingsam   add iview.install()
126
127
128
129
  
  // auto install
  if (typeof window !== 'undefined' && window.Vue) {
      install(window.Vue);
451b52ce   梁灏   Global install iView
130
  }
343abe50   jingsam   add iview.install()
131
  
b0893113   jingsam   :art: add eslint
132
  module.exports = Object.assign(iview, {install});   // eslint-disable-line no-undef