// The Vue build version to load with the `import` command
|
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
|
import Vue from 'vue'
|
import App from './App'
|
import router from './router'
|
|
// 组件ElementUI
|
import ElementUI from 'element-ui'
|
import 'element-ui/lib/theme-chalk/index.css'
|
|
// vuex状态管理
|
import store from './store'
|
// 样式
|
import less from 'less'
|
import '@/styles/index.scss' // global css
|
import '@/styles/animate.css'
|
|
// 自定义全局点击空白处组件
|
import clickoutside from './directives' // global filters
|
import focus from './directives/focus'
|
import empty from './directives/empty'
|
import photo from './directives/photo'
|
import Lockr from 'lockr'
|
/** 常用flex组件 */
|
import {
|
Flexbox,
|
FlexboxItem
|
} from '@/components/flexbox'
|
/** 事件传递 */
|
import VueBus from 'vue-bus'
|
/** 懒加载图片 */
|
import VueLazyload from 'vue-lazyload'
|
import * as filters from './filters'
|
import moment from 'moment'
|
// 表情
|
import {
|
emoji
|
} from './utils/emoji' // global filters
|
import fullCalendar from 'vue-fullcalendar'
|
// import cache from '@/utils/cache'
|
import 'lib-flexible'
|
|
// cache.loadingCache()
|
|
Vue.component('full-calendar', fullCalendar)
|
|
// 注册全局过滤器
|
Object.keys(filters).forEach(key => {
|
Vue.filter(key, filters[key])
|
})
|
|
// 处理时间的过滤器
|
Vue.use(require('vue-moment'))
|
moment.locale('zh_cn')
|
|
Vue.use(VueLazyload, {
|
preLoad: 1.3,
|
error: require('@/assets/img/send_img.png'),
|
loading: require('@/assets/img/loading.gif'),
|
attempt: 1
|
})
|
|
Vue.prototype.emoji = emoji
|
|
Vue.use(VueBus)
|
Vue.component('flexbox', Flexbox)
|
Vue.component('flexbox-item', FlexboxItem)
|
Vue.use(empty)
|
Vue.use(photo) // 本地存储插件
|
console.log(process.env.NODE_ENV)
|
|
window.Lockr = Lockr // 使用本地存储插件
|
Vue.directive('clickoutside', clickoutside)
|
Vue.directive('focus', focus)
|
Vue.use(ElementUI, {zIndex: 3000})
|
|
Vue.use(less)
|
|
Vue.config.productionTip = false
|
|
/* eslint-disable no-new */
|
new Vue({
|
el: '#app',
|
router,
|
store,
|
components: { App },
|
template: '<App/>'
|
})
|