|
|
|
|
@ -41,8 +41,6 @@ import '@/plugins/tongji' // 百度统计
|
|
|
|
|
import Logger from '@/utils/Logger'
|
|
|
|
|
|
|
|
|
|
import VueDOMPurifyHTML from 'vue-dompurify-html' // 解决v-html 的安全隐患
|
|
|
|
|
import { hiPrintPlugin } from 'vue-plugin-hiprint'
|
|
|
|
|
import 'vue-plugin-hiprint/dist/print-lock.css'
|
|
|
|
|
|
|
|
|
|
// 创建实例
|
|
|
|
|
const setupAll = async () => {
|
|
|
|
|
@ -58,9 +56,6 @@ const setupAll = async () => {
|
|
|
|
|
|
|
|
|
|
setupFormCreate(app)
|
|
|
|
|
|
|
|
|
|
app.use(hiPrintPlugin, '$hiprint', false)
|
|
|
|
|
hiPrintPlugin.disAutoConnect()
|
|
|
|
|
|
|
|
|
|
setupRouter(app)
|
|
|
|
|
|
|
|
|
|
// directives 指令
|
|
|
|
|
@ -72,6 +67,17 @@ const setupAll = async () => {
|
|
|
|
|
app.use(VueDOMPurifyHTML)
|
|
|
|
|
|
|
|
|
|
app.mount('#app')
|
|
|
|
|
|
|
|
|
|
// 静默异步加载打印插件(vue-plugin-hiprint 体积较大且内含 jQuery),
|
|
|
|
|
// 放到 mount 之后动态加载,避免其 chunk 阻塞首屏渲染与后续请求
|
|
|
|
|
import('vue-plugin-hiprint')
|
|
|
|
|
.then(({ hiPrintPlugin }) => {
|
|
|
|
|
app.use(hiPrintPlugin, '$hiprint', false)
|
|
|
|
|
hiPrintPlugin.disAutoConnect()
|
|
|
|
|
})
|
|
|
|
|
.catch((e) => {
|
|
|
|
|
console.error('[hiprint] 打印插件加载失败:', e)
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
setupAll()
|
|
|
|
|
|