1 | import { Button, ButtonGroup } from './components/button'
|
2 | import Tag from './components/tag'
|
3 | import { Radio, RadioGroup, RadioButton } from './components/radio'
|
4 | import { Checkbox, CheckboxGroup } from './components/checkbox'
|
5 | import Input from './components/input'
|
6 | import InputNumber from './components/input-number'
|
7 | import Textarea from './components/textarea'
|
8 | import Badge from './components/badge'
|
9 | import Switch from './components/switch'
|
10 | import Slider from './components/slider'
|
11 | import Tooltip from './components/tooltip'
|
12 | import Popover from './components/popover'
|
13 | import Alert from './components/alert'
|
14 | import Notification from './components/notification'
|
15 | import Progress from './components/progress'
|
16 | import LoadingBar from './components/loading-bar'
|
17 | import { Modal, Dialog } from './components/modal'
|
18 | import { Select, Option, OptionGroup } from './components/select'
|
19 | import { Dropdown, DropdownMenu, DropdownItem } from './components/dropdown'
|
20 | import { Breadcrumb, BreadcrumbItem } from './components/breadcrumb'
|
21 | import Pagination from './components/pagination'
|
22 | import Message from './components/message'
|
23 | import { Menu, MenuItem, MenuItemGroup, Submenu } from './components/menu'
|
24 | import Table from './components/table'
|
25 |
|
26 | const components = {
|
27 | Button,
|
28 | ButtonGroup,
|
29 | Tag,
|
30 | Radio,
|
31 | RadioGroup,
|
32 | RadioButton,
|
33 | Checkbox,
|
34 | CheckboxGroup,
|
35 | Input,
|
36 | InputNumber,
|
37 | Textarea,
|
38 | Badge,
|
39 | Switch,
|
40 | Slider,
|
41 | Tooltip,
|
42 | Popover,
|
43 | Alert,
|
44 | Progress,
|
45 | LoadingBar,
|
46 | Modal,
|
47 | Select,
|
48 | Option,
|
49 | OptionGroup,
|
50 | Dropdown,
|
51 | DropdownMenu,
|
52 | DropdownItem,
|
53 | Breadcrumb,
|
54 | BreadcrumbItem,
|
55 | Pagination,
|
56 | Menu,
|
57 | MenuItem,
|
58 | MenuItemGroup,
|
59 | Submenu,
|
60 | Table
|
61 | }
|
62 |
|
63 | function install (Vue) {
|
64 | if (install.installed) return
|
65 |
|
66 | for (const item in components) {
|
67 | if (components[item].name) {
|
68 | Vue.component(components[item].name, components[item])
|
69 | }
|
70 | }
|
71 |
|
72 | Vue.prototype.$Notify = Notification
|
73 | Vue.prototype.$Loading = LoadingBar
|
74 | Vue.prototype.$Modal = Dialog
|
75 | Vue.prototype.$Message = Message
|
76 | }
|
77 |
|
78 |
|
79 |
|
80 |
|
81 | if (typeof window !== 'undefined' && window.Vue) {
|
82 | install(window.Vue)
|
83 | }
|
84 |
|
85 | export default {
|
86 | install,
|
87 | ...components
|
88 | }
|