UNPKG

m2-webui

Version:

The package is provided web components and utilities based on vue and element-ui.

81 lines (72 loc) 1.86 kB
/* Automatically generated by './build/bin/build-entry.js' */ import Container from '../packages/container' import Layout from '../packages/layout' import Loading from '../packages/loading' import Toast from '../packages/toast' import Table from '../packages/table' import Tooltip from '../packages/tooltip' import Link from '../packages/link' import Exception from '../packages/exception' import SvgIcon from '../packages/svg-icon' import Modal from '../packages/modal' import Alert from '../packages/alert' import Prompt from '../packages/prompt' import RouterView from '../packages/router-view' import QueryPanel from '../packages/query-panel' import QueryResult from '../packages/query-result' import filters from 'm2-vue/dist/filters' import locale from 'm2-webui/src/locale' import EventBus from 'm2-webui/src/utils/bus' const components = [ Container, Layout, Table, Tooltip, Link, Exception, SvgIcon, Modal, RouterView, QueryPanel, QueryResult ] const install = (Vue, opts = {}) => { locale.use(opts.locale) locale.i18n(opts.i18n) components.forEach(component => { Vue.component(component.name, component) }) filters.forEach(item => Vue.filter(item.name, item.rule)) Vue.prototype.$bus = new EventBus() Vue.prototype.$m2 = {} Vue.prototype.$m2.loading = Loading Vue.prototype.$m2.loading.hide = Loading.hide Vue.prototype.$m2.toast = Toast Vue.prototype.$m2.alert = Alert Vue.prototype.$m2.prompt = Prompt Vue.prototype.$m2.prompt.hide = Prompt.hide } if (typeof window !== 'undefined' && window.Vue) { install(window.Vue) } export default { version: '1.0.1-beta.1', locale: locale.use, i18n: locale.i18n, install, Container, Layout, Loading, Toast, Table, Tooltip, Link, Exception, SvgIcon, Modal, Alert, Prompt, RouterView, QueryPanel, QueryResult }