77 lines
2.2 KiB
JavaScript
77 lines
2.2 KiB
JavaScript
import Vue from 'vue'
|
|
import App from './App.vue'
|
|
import fetchApi from './services/fetchApi'
|
|
import router from './router' /*引入路由设置*/
|
|
import store from './store' /*引入store vuex设置*/
|
|
import MetaInfo from 'vue-meta-info' /*动态设置meta标签*/
|
|
import './assets/icons' // svg图标
|
|
import filter from "./filters";
|
|
import util from "./utils/util"
|
|
import verify from "./utils/verify"
|
|
import clickThrottle from "./utils/clickThrottle"
|
|
import {Message,Loading} from 'element-ui'
|
|
import * as echarts from 'echarts'; /*echarts图表 示例 https://echarts.apache.org/examples/zh/index.html */
|
|
import ElementUI from 'element-ui';
|
|
import './assets/style/element-ui-variable.scss'
|
|
// import 'element-ui/lib/theme-chalk/index.css';
|
|
import 'element-ui/lib/theme-chalk/icon.css'
|
|
import {TrydoFiles} from "@trydo/files-utils"
|
|
// 引入全局通用自定义指令
|
|
import '@/assets/js/directive';
|
|
import '@/assets/js/directiveVideo';
|
|
|
|
|
|
Vue.use(ElementUI);
|
|
|
|
// 全局导入过滤器
|
|
Object.keys(filter).forEach(key => Vue.filter(key, filter[key]));
|
|
|
|
Vue.prototype.$message = Message;
|
|
Vue.prototype.$loading = Loading.service;
|
|
Vue.prototype.$fetchApi = fetchApi;
|
|
Vue.prototype.$util = util;
|
|
Vue.prototype.$verify = verify;
|
|
Vue.prototype.$clickThrottle = clickThrottle;
|
|
Vue.prototype.$echarts = echarts;
|
|
Vue.prototype.$TrydoFiles = TrydoFiles;
|
|
|
|
// vue使用vue-meta-info来动态设置标题
|
|
Vue.use(MetaInfo)
|
|
|
|
new Vue({
|
|
data(){
|
|
return {
|
|
keyWords:null,//关键字
|
|
description:null,//描述
|
|
sitetitle:null,//标题
|
|
sitetitleinit:null//
|
|
}
|
|
},
|
|
metaInfo () {
|
|
return {
|
|
title: this.sitetitle,
|
|
meta: [{name: 'keyWords',content: this.keyWords},{name: 'description',content: this.description}]
|
|
}
|
|
},
|
|
router,
|
|
store,
|
|
render: h => h(App),
|
|
watch:{
|
|
'$route': function(to, from) {
|
|
console.log(to,from,'路由信息')
|
|
if(to.meta.title!=null&&to.meta.sitetitleinit!=null)
|
|
{
|
|
this.sitetitle=to.meta.title+'-'+this.sitetitleinit;
|
|
}
|
|
if(to.meta.sitetitleinit!=null)
|
|
{
|
|
this.sitetitle=this.sitetitleinit;
|
|
}
|
|
else
|
|
{
|
|
this.sitetitle=to.meta.title;
|
|
}
|
|
}
|
|
}
|
|
}).$mount('#app')
|