Skip to content
This repository has been archived by the owner on Nov 30, 2020. It is now read-only.

Commit

Permalink
refactor: Remove async loading of components (fixes #29)
Browse files Browse the repository at this point in the history
  • Loading branch information
matsp committed Dec 10, 2017
1 parent 2ed764f commit 5686399
Show file tree
Hide file tree
Showing 25 changed files with 153 additions and 64 deletions.
4 changes: 3 additions & 1 deletion components/Button/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import Button from './Button.vue'

export default {
install (vm) {
vm.component('m-button', () => import('./Button'))
vm.component('m-button', Button)
}
}
7 changes: 5 additions & 2 deletions components/Card/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import Card from './Card.vue'
import CardMediaItem from './CardMediaItem.vue'

export default {
install (vm) {
vm.component('m-card', () => import('./Card'))
vm.component('m-card-media-item', () => import('./CardMediaItem'))
vm.component('m-card', Card)
vm.component('m-card-media-item', CardMediaItem)
}
}
4 changes: 3 additions & 1 deletion components/Checkbox/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import Checkbox from './Checkbox.vue'

export default {
install (vm) {
vm.component('m-checkbox', () => import('./Checkbox'))
vm.component('m-checkbox', Checkbox)
}
}
4 changes: 3 additions & 1 deletion components/Dialog/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import Dialog from './Dialog.vue'

export default {
install (vm) {
vm.component('m-dialog', () => import('./Dialog'))
vm.component('m-dialog', Dialog)
}
}
22 changes: 15 additions & 7 deletions components/Drawer/index.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
import PermanentDrawer from './PermanentDrawer/PermanentDrawer.vue'
import PermanentDrawerListItem from './PermanentDrawer/PermanentDrawerListItem.vue'
import PersistentDrawer from './PersistentDrawer/PersistentDrawer.vue'
import PersistentDrawerListItem from './PersistentDrawer/PersistentDrawerListItem.vue'
import TemporaryDrawer from './TemporaryDrawer/TemporaryDrawer.vue'
import TemporaryDrawerListItem from './TemporaryDrawer/TemporaryDrawerListItem.vue'
import DrawerItemDivider from './DrawerItemDivider.vue'

export default {
install (vm) {
vm.component('m-permanent-drawer', () => import('./PermanentDrawer/PermanentDrawer'))
vm.component('m-permanent-drawer-item', () => import('./PermanentDrawer/PermanentDrawerListItem'))
vm.component('m-persistent-drawer', () => import('./PersistentDrawer/PersistentDrawer'))
vm.component('m-persistent-drawer-item', () => import('./PersistentDrawer/PersistentDrawerListItem'))
vm.component('m-temporary-drawer', () => import('./TemporaryDrawer/TemporaryDrawer'))
vm.component('m-temporary-drawer-item', () => import('./TemporaryDrawer/TemporaryDrawerListItem'))
vm.component('m-drawer-item-divider', () => import('./DrawerItemDivider'))
vm.component('m-permanent-drawer', PermanentDrawer)
vm.component('m-permanent-drawer-item', PermanentDrawerListItem)
vm.component('m-persistent-drawer', PersistentDrawer)
vm.component('m-persistent-drawer-item', PersistentDrawerListItem)
vm.component('m-temporary-drawer', TemporaryDrawer)
vm.component('m-temporary-drawer-item', TemporaryDrawerListItem)
vm.component('m-drawer-item-divider', DrawerItemDivider)
}
}
4 changes: 3 additions & 1 deletion components/Elevation/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import Elevation from './Elevation.vue'

export default {
install (vm) {
vm.component('m-elevation', () => import('./Elevation'))
vm.component('m-elevation', Elevation)
}
}
4 changes: 3 additions & 1 deletion components/Fab/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import Fab from './Fab.vue'

export default {
install (vm) {
vm.component('m-fab', () => import('./Fab'))
vm.component('m-fab', Fab)
}
}
4 changes: 3 additions & 1 deletion components/FormField/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import FormField from './FormField.vue'

export default {
install (vm) {
vm.component('m-form-field', () => import('./FormField'))
vm.component('m-form-field', FormField)
}
}
7 changes: 5 additions & 2 deletions components/GridList/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import GridList from './GridList.vue'
import GridListTile from './GridListTile.vue'

export default {
install (vm) {
vm.component('m-grid-list', () => import('./GridList'))
vm.component('m-grid-tile', () => import('./GridListTile'))
vm.component('m-grid-list', GridList)
vm.component('m-grid-tile', GridListTile)
}
}
4 changes: 3 additions & 1 deletion components/Icon/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import Icon from './Icon.vue'

export default {
install (vm) {
vm.component('m-icon', () => import('./Icon'))
vm.component('m-icon', Icon)
}
}
4 changes: 3 additions & 1 deletion components/IconToggle/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import IconToggle from './IconToggle.vue'

export default {
install (vm) {
vm.component('m-icon-toggle', () => import('./IconToggle'))
vm.component('m-icon-toggle', IconToggle)
}
}
10 changes: 7 additions & 3 deletions components/LayoutGrid/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import LayoutGrid from './LayoutGrid.vue'
import LayoutGridCell from './LayoutGridCell.vue'
import LayoutGridInner from './LayoutGridInner.vue'

export default {
install (vm) {
vm.component('m-layout-grid', () => import('./LayoutGrid'))
vm.component('m-layout-grid-cell', () => import('./LayoutGridCell'))
vm.component('m-layout-grid-inner', () => import('./LayoutGridInner'))
vm.component('m-layout-grid', LayoutGrid)
vm.component('m-layout-grid-cell', LayoutGridCell)
vm.component('m-layout-grid-inner', LayoutGridInner)
}
}
4 changes: 3 additions & 1 deletion components/LinearProgress/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import LinearProgress from './LinearProgress.vue'

export default {
install (vm) {
vm.component('m-linear-progress', () => import('./LinearProgress'))
vm.component('m-linear-progress', LinearProgress)
}
}
19 changes: 13 additions & 6 deletions components/List/index.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
import List from './List.vue'
import ListDivider from './ListDivider.vue'
import ListGroup from './ListGroup.vue'
import ListGroupDivider from './ListGroupDivider.vue'
import ListGroupSubheader from './ListGroupSubheader.vue'
import ListItem from './ListItem.vue'

export default {
install (vm) {
vm.component('m-list', () => import('./List'))
vm.component('m-list-divider', () => import('./ListDivider'))
vm.component('m-list-group', () => import('./ListGroup'))
vm.component('m-list-list-group-divider', () => import('./ListGroupDivider'))
vm.component('m-list-list-group-subheader', () => import('./ListGroupSubheader'))
vm.component('m-list-item', () => import('./ListItem'))
vm.component('m-list', List)
vm.component('m-list-divider', ListDivider)
vm.component('m-list-group', ListGroup)
vm.component('m-list-list-group-divider', ListGroupDivider)
vm.component('m-list-list-group-subheader', ListGroupSubheader)
vm.component('m-list-item', ListItem)
}
}
22 changes: 15 additions & 7 deletions components/Menu/index.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
import Menu from './Menu.vue'
import MenuAnchor from './MenuAnchor.vue'
import MenuDivider from './MenuDivider.vue'
import MenuGroup from './MenuGroup.vue'
import MenuGroupDivider from './MenuGroupDivider.vue'
import MenuGroupSubheader from './MenuGroupSubheader.vue'
import MenuItem from './MenuItem.vue'

export default {
install (vm) {
vm.component('m-menu', () => import('./Menu'))
vm.component('m-menu-anchor', () => import('./MenuAnchor'))
vm.component('m-menu-divider', () => import('./MenuDivider'))
vm.component('m-menu-group', () => import('./MenuGroup'))
vm.component('m-menu-group-divider', () => import('./MenuGroupDivider'))
vm.component('m-menu-group-subheader', () => import('./MenuGroupSubheader'))
vm.component('m-menu-item', () => import('./MenuItem'))
vm.component('m-menu', Menu)
vm.component('m-menu-anchor', MenuAnchor)
vm.component('m-menu-divider', MenuDivider)
vm.component('m-menu-group', MenuGroup)
vm.component('m-menu-group-divider', MenuGroupDivider)
vm.component('m-menu-group-subheader', MenuGroupSubheader)
vm.component('m-menu-item', MenuItem)
}
}
4 changes: 3 additions & 1 deletion components/Radio/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import Radio from './Radio.vue'

export default {
install (vm) {
vm.component('m-radio', () => import('./Radio'))
vm.component('m-radio', Radio)
}
}
4 changes: 3 additions & 1 deletion components/Ripple/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import Ripple from './Ripple.vue'

export default {
install (vm) {
vm.component('m-ripple', () => import('./Ripple'))
vm.component('m-ripple', Ripple)
}
}
19 changes: 13 additions & 6 deletions components/Select/index.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
import Select from './Select.vue'
import SelectMulti from './SelectMulti.vue'
import SelectMultiDivider from './SelectMultiDivider.vue'
import SelectMultiGroup from './SelectMultiGroup.vue'
import SelectMultiOption from './SelectMultiOption.vue'
import SelectOption from './SelectOption.vue'

export default {
install (vm) {
vm.component('m-select', () => import('./Select'))
vm.component('m-select-multi', () => import('./SelectMulti'))
vm.component('m-select-multi-divider', () => import('./SelectMultiDivider'))
vm.component('m-select-multi-group', () => import('./SelectMultiGroup'))
vm.component('m-select-multi-option', () => import('./SelectMultiOption'))
vm.component('m-select-option', () => import('./SelectOption'))
vm.component('m-select', Select)
vm.component('m-select-multi', SelectMulti)
vm.component('m-select-multi-divider', SelectMultiDivider)
vm.component('m-select-multi-group', SelectMultiGroup)
vm.component('m-select-multi-option', SelectMultiOption)
vm.component('m-select-option', SelectOption)
}
}
4 changes: 3 additions & 1 deletion components/Slider/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import Slider from './Slider.vue'

export default {
install (vm) {
vm.component('m-slider', () => import('./Slider'))
vm.component('m-slider', Slider)
}
}
4 changes: 3 additions & 1 deletion components/Snackbar/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import Snackbar from './Snackbar.vue'

export default {
install (vm) {
vm.component('m-snackbar', () => import('./Snackbar'))
vm.component('m-snackbar', Snackbar)
}
}
4 changes: 3 additions & 1 deletion components/Switch/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import Switch from './Switch.vue'

export default {
install (vm) {
vm.component('m-switch', () => import('./Switch'))
vm.component('m-switch', Switch)
}
}
7 changes: 5 additions & 2 deletions components/Tabs/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import Tab from './Tab.vue'
import TabBar from './TabBar.vue'

export default {
install (vm) {
vm.component('m-tab', () => import('./Tab'))
vm.component('m-tab-bar', () => import('./TabBar'))
vm.component('m-tab', Tab)
vm.component('m-tab-bar', TabBar)
}
}
10 changes: 7 additions & 3 deletions components/Textfield/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import Textfield from './Textfield.vue'
import TextfieldHelptext from './TextfieldHelptext.vue'
import TextfieldMultiline from './TextfieldMultiline.vue'

export default {
install (vm) {
vm.component('m-textfield', () => import('./Textfield'))
vm.component('m-textfield-helptext', () => import('./TextfieldHelptext'))
vm.component('m-textfield-multiline', () => import('./TextfieldMultiline'))
vm.component('m-textfield', Textfield)
vm.component('m-textfield-helptext', TextfieldHelptext)
vm.component('m-textfield-multiline', TextfieldMultiline)
}
}
13 changes: 9 additions & 4 deletions components/Toolbar/index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
import Toolbar from './Toolbar.vue'
import ToolbarFixedAdjust from './ToolbarFixedAdjust.vue'
import ToolbarIcon from './ToolbarIcon.vue'
import ToolbarRow from './ToolbarRow.vue'

export default {
install (vm) {
vm.component('m-toolbar', () => import('./Toolbar'))
vm.component('m-toolbar-fixed-adjust', () => import('./ToolbarFixedAdjust'))
vm.component('m-toolbar-icon', () => import('./ToolbarIcon'))
vm.component('m-toolbar-row', () => import('./ToolbarRow'))
vm.component('m-toolbar', Toolbar)
vm.component('m-toolbar-fixed-adjust', ToolbarFixedAdjust)
vm.component('m-toolbar-icon', ToolbarIcon)
vm.component('m-toolbar-row', ToolbarRow)
}
}
25 changes: 17 additions & 8 deletions components/Typography/index.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
import Body from './Body.vue'
import Button from './Button.vue'
import Caption from './Caption.vue'
import Display from './Display.vue'
import Headline from './Headline.vue'
import Title from './Title.vue'
import Subheading from './Subheading.vue'
import Typography from './Typography.vue'

export default {
install (vm) {
vm.component('m-typo-body', () => import('./Body'))
vm.component('m-typo-button', () => import('./Button'))
vm.component('m-typo-caption', () => import('./Caption'))
vm.component('m-typo-display', () => import('./Display'))
vm.component('m-typo-headline', () => import('./Headline'))
vm.component('m-typo-title', () => import('./Title'))
vm.component('m-typo-subheading', () => import('./Subheading'))
vm.component('m-typography', () => import('./Typography'))
vm.component('m-typo-body', Body)
vm.component('m-typo-button', Button)
vm.component('m-typo-caption', Caption)
vm.component('m-typo-display', Display)
vm.component('m-typo-headline', Headline)
vm.component('m-typo-title', Title)
vm.component('m-typo-subheading', Subheading)
vm.component('m-typography', Typography)
}
}

0 comments on commit 5686399

Please sign in to comment.