mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-23 11:27:24 +08:00
admin-import
This commit is contained in:
Vendored
+48
-4
@@ -1,8 +1,52 @@
|
||||
import { createApp } from 'vue'
|
||||
import ElementPlus from 'element-plus';
|
||||
import App from './App.vue'
|
||||
import installElementPlus from './plugins/element'
|
||||
import router from './router'
|
||||
import router from './router/index'
|
||||
|
||||
const app = createApp(App).use(router)
|
||||
installElementPlus(app)
|
||||
import 'element-plus/lib/theme-chalk/index.css'
|
||||
|
||||
// 修改后的主题样式必须放在最后面
|
||||
import '../theme/index.css'
|
||||
|
||||
const orderStatus = {
|
||||
0: '待支付',
|
||||
1: '已支付',
|
||||
2: '配货完成',
|
||||
3: '出库成功',
|
||||
4: '交易成功',
|
||||
'-1': '手动关闭',
|
||||
'-2': '超时关闭',
|
||||
'-3': '商家关闭'
|
||||
}
|
||||
|
||||
const app = createApp(App)
|
||||
// 全局过滤器
|
||||
app.config.globalProperties.$filters = {
|
||||
orderMap(status) {
|
||||
return orderStatus[status] || '未知状态'
|
||||
},
|
||||
prefix(url) {
|
||||
if (url && url.startsWith('http')) {
|
||||
return url
|
||||
} else {
|
||||
url = `http://backend-api-02.newbee.ltd${url}`
|
||||
return url
|
||||
}
|
||||
},
|
||||
resetImgUrl(imgObj, imgSrc, maxErrorNum) {
|
||||
if (maxErrorNum > 0) {
|
||||
imgObj.onerror = function() {
|
||||
resetImgUrl(imgObj, imgSrc, maxErrorNum - 1)
|
||||
}
|
||||
setTimeout(function() {
|
||||
imgObj.src = imgSrc
|
||||
}, 500)
|
||||
} else {
|
||||
imgObj.onerror = null
|
||||
imgObj.src = imgSrc
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
app.use(router).use(ElementPlus)
|
||||
app.mount('#app')
|
||||
|
||||
Reference in New Issue
Block a user