1 Star 0 Fork 18

姗姗来迟/ uniapp移动端开发框架Vue3.0

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
main.js 1.67 KB
一键复制 编辑 原始数据 按行查看 历史
编程民工 提交于 2023-08-12 17:15 . webpack转vite,使用vue3组合api
import App from './App'
import { createSSRApp } from 'vue'
import * as Pinia from 'pinia'
// #ifdef MP
import share from './mixin/sju.share.js'
// #endif
// 引入导航栏组件
import uniNavBar from '@/components/uni-nav-bar/uni-nav-bar.vue'
//导入自己封装的类库
import * as sjuAsync from './common/sju.async.js'
import * as sjuBase from './common/sju.base.js'
import * as sjuAlert from './common/sju.alert.js'
import * as sjuRegex from './common/sju.regex.js'
import * as sjuLogin from './common/sju.login.js'
import * as sjuNav from './common/sju.nav.js'
import * as sjuPay from './common/sju.pay.js'
import * as sjuTools from './common/sju.tools.js'
import * as sjuRequest from './common/sju.request.js'
// #ifdef H5
import * as sjuWeixin from './common/sju.weixin.js'
// #endif
export function createApp() {
const app = createSSRApp(App)
app.use(Pinia.createPinia())
app.use(uniNavBar)
// #ifdef MP
app.mixin(share)
// #endif
// 将封装库引入
app.config.globalProperties.sjuBase= sjuBase
app.config.globalProperties.sjuAlert= sjuAlert
app.config.globalProperties.sjuRequest= sjuRequest
app.config.globalProperties.sjuAsync= sjuAsync
app.config.globalProperties.sjuLogin= sjuLogin
app.config.globalProperties.sjuNav= sjuNav
app.config.globalProperties.sjuPay= sjuPay
app.config.globalProperties.sjuTools= sjuTools
// #ifdef H5
app.config.globalProperties.sjuWeixin= sjuWeixin
// #endif
// 全局变量
// 设置H5分享参数全局变量
app.config.globalProperties.$title='分享标题';
app.config.globalProperties.$desc = '分享描述';
app.config.globalProperties.$shareImage = '图片路径';
return {
app,
Pinia
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/shanshanop/uniapp_mobileFrame_Vue3.git
git@gitee.com:shanshanop/uniapp_mobileFrame_Vue3.git
shanshanop
uniapp_mobileFrame_Vue3
uniapp移动端开发框架Vue3.0
master

搜索帮助