Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
web-framework-temp
/
vue-cli3-vt-template-master
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
d7a783c4
authored
2024-01-25 15:42:34 +0800
by
simon
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
微信授权调整
1 parent
b15d3021
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
42 deletions
src/main.js
src/main.js
View file @
d7a783c
...
...
@@ -10,6 +10,10 @@ import {
formdata
}
from
'@/api/fetch-api.js'
import
{
getQuery
,
}
from
'@/utils/utils'
// import Mock from './mock'
// Mock.bootstrap();
...
...
@@ -33,9 +37,43 @@ import {
// routes里的component组件需要以import方式引入,否则页面创建的时候,app还没挂载。
let
util
=
require
(
'@/utils/utils'
);
let
func
=
require
(
'@/utils/func'
);
// function initVue() {
// 挂载全局app
app
.
api
=
api
;
app
.
get
=
httpGet
;
app
.
post
=
httpPost
;
app
.
uploadFile
=
formdata
;
app
.
router
=
router
;
app
.
util
=
util
;
app
.
func
=
func
;
app
.
vant
=
{
Dialog
,
Toast
}
window
.
app
=
app
;
function
initVue
()
{
window
.
vue
=
new
Vue
({
router
,
store
,
data
:
{
isInit
:
false
,
globalData
:
{
ui
:
{
colorUI
:
"#409EFF"
,
colorDanger
:
"#EE0A24"
},
},
},
render
:
h
=>
h
(
VueApp
)
}).
$mount
(
'#app'
)
}
// 微信授权
// function initVue() {
// let codeSn = getQuery("c");
// if (process.env.NODE_ENV == "development") {
// openid = "oDPvDjjha8EVFhJaceqxs3Bta-1k";
...
...
@@ -83,46 +121,7 @@ import {
// render: h => h(VueApp)
// }).$mount('#app');
// // console.log('window.vue:',window.vue);
// }).catch((err) => {
// });
// }).catch((err) => {});
// }
// initVue();
let
util
=
require
(
'@/utils/utils'
);
let
func
=
require
(
'@/utils/func'
);
// let Toast = vant.Toast;
// let Dialog = vant.Dialog;
let
app
=
new
Vue
({
router
,
store
,
data
:
{
isInit
:
false
,
globalData
:
{
ui
:
{
colorUI
:
"#409EFF"
,
colorDanger
:
"#EE0A24"
},
},
},
render
:
h
=>
h
(
VueApp
)
}).
$mount
(
'#app'
)
// 挂载全局app
app
.
api
=
api
;
app
.
get
=
httpGet
;
app
.
post
=
httpPost
;
app
.
uploadFile
=
formdata
;
app
.
router
=
router
;
app
.
util
=
util
;
app
.
func
=
func
;
app
.
vant
=
{
Dialog
,
Toast
}
window
.
app
=
app
;
\ No newline at end of file
initVue
();
\ No newline at end of file
...
...
Please
register
or
sign in
to post a comment