1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586 |
- import Vue from 'vue'
- import 'normalize.css/normalize.css'
- import ElementUI from 'element-ui'
- import 'element-ui/lib/theme-chalk/index.css'
- import echarts from 'echarts'
- import '@/styles/index.scss'
- import '@/customIcons/icon.css'
- import App from './App.vue'
- import store from './store'
- import router from './router'
- import '@/icons'
- import '@/permission'
- Vue.prototype.$echarts = echarts
- Vue.directive('tableHeight', {
- update(el, binding) {
- function changeElHeight() {
- let height = 0
- if (!binding.value) {
- const navbarHeight = 46
- const tabsHeight = 62
- const searchHeight = document.querySelector('.app-container>.filter-container') ? document.querySelector('.app-container>.filter-container').offsetHeight : 0
- const pageHeight = document.querySelector('.app-container>.pagination-container') ? 75 : 20
- const otherHeight = document.querySelector('.app-container>.other-container') ? document.querySelector('.app-container>.other-container').offsetHeight : 0
- height = navbarHeight + tabsHeight + searchHeight + pageHeight + otherHeight
- } else {
- height = binding.value
- }
- el.style.height = `${window.innerHeight - height > 230 ? window.innerHeight - height : 230}px`
- }
- changeElHeight()
- window.onresize = () => {
- changeElHeight()
- }
- }
- })
- Vue.use(ElementUI)
- Vue.prototype.common = {
- seamingImgUrl(url) {
- if (!url) return ''
-
- if (url.startsWith('http://')) {
- return url.replace('http://', 'https://')
- } else if (url.startsWith('https://')) {
- return url
- } else if (url.startsWith('//')) {
- return 'https:' + url
- }
-
-
- return 'https://jufeng-shop-1317254189.cos.ap-guangzhou.myqcloud.com/' + url
- }
- }
- Vue.config.productionTip = false
- new Vue({
- el: '#app',
- router,
- store,
- render: (h) => h(App)
- })
|