| 1234567891011121314151617181920212223242526272829303132333435363738394041 |
- import Vue from 'vue';
- import '@/styles/font/font.css';
- import ElementUI from 'element-ui';
- import 'element-ui/lib/theme-chalk/index.css';
- import '@/icons';
- import '@/utils/mathjax'; // 必须在引入mathjax前引入mathjax的配置文件
- import 'mathjax/es5/tex-mml-chtml';
- import VueSignaturePad from 'vue-signature-pad';
- import BookEep from './BookEep.vue';
- const components = [BookEep];
- Vue.use(ElementUI, {
- size: 'small',
- });
- Vue.use(VueSignaturePad);
- // 定义 install 方法,接收 Vue 作为参数。如果使用 use 注册插件,则所有的组件都将被注册
- const install = (VueInstance) => {
- if (install.installed) return;
- install.installed = true;
- components.forEach((component) => {
- VueInstance.component(component.name || 'BookEep', component);
- });
- };
- // 判断是否是直接引入文件,如果是,就不用调用 Vue.use()
- if (typeof window !== 'undefined' && window.Vue) {
- install(window.Vue);
- }
- // 导出的对象必须具有 install,才能被 Vue.use() 方法安装
- export default {
- install,
- };
|