You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
43 lines
1.3 KiB
JavaScript
43 lines
1.3 KiB
JavaScript
import App from './App.vue'
|
|
import plugins from './plugins'
|
|
import store from './store'
|
|
import uviewPlus from 'uview-plus'
|
|
import ElementPlus from 'element-plus' //添加
|
|
import 'element-plus/dist/index.css' //添加
|
|
import locale from "element-plus/es/locale/lang/zh-cn"
|
|
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
|
|
|
|
|
|
import { createSSRApp } from 'vue'
|
|
import directive from './directive' // directive
|
|
|
|
import { useDict } from '@/utils/dict'
|
|
import { parseTime, resetForm, addDateRange, handleTree, selectDictLabel, selectDictLabels } from '@/utils/ruoyi'
|
|
|
|
|
|
|
|
export function createApp() {
|
|
const app = createSSRApp(App)
|
|
app.use(store)
|
|
app.use(uviewPlus)
|
|
app.use(plugins)
|
|
app.use(ElementPlus, {locale})
|
|
for (const [key, component] of Object.entries(ElementPlusIconsVue)){
|
|
app.component(key, component)
|
|
}
|
|
directive(app)
|
|
|
|
// 全局方法挂载
|
|
app.config.globalProperties.useDict = useDict
|
|
app.config.globalProperties.parseTime = parseTime
|
|
app.config.globalProperties.resetForm = resetForm
|
|
app.config.globalProperties.handleTree = handleTree
|
|
app.config.globalProperties.addDateRange = addDateRange
|
|
app.config.globalProperties.selectDictLabel = selectDictLabel
|
|
app.config.globalProperties.selectDictLabels = selectDictLabels
|
|
|
|
return {
|
|
app
|
|
}
|
|
}
|