Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
CFFP-HB
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chao Sun
CFFP-HB
Commits
68d02135
Commit
68d02135
authored
Jul 24, 2025
by
zhangxingmin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
push
parent
2ba07d78
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
11 deletions
+7
-11
main.js
+7
-11
No files found.
main.js
View file @
68d02135
import
App
from
'./App.vue'
;
// #ifdef VUE3
import
{
createApp
}
from
'vue'
// 注意这里改成 createApp
import
{
createApp
}
from
'vue'
// 创建应用实例
const
app
=
createApp
(
App
)
// 使用 createApp
// 创建应用实例并挂载
const
vueApp
=
createApp
(
App
)
// 重命名变量避免冲突
vueApp
.
mount
(
'#app'
)
// 挂载应用
app
.
mount
(
'#app'
)
// 导出 createApp 函数供 SSR 使用
export
function
createApp
()
{
return
{
app
}
// 如果需要导出,使用不同名称的函数
export
function
createSSRApp
()
{
return
{
app
:
vueApp
}
}
// #endif
// #ifndef VUE3
// Vue 2 兼容代码
import
Vue
from
'vue'
import
App
from
'./App'
Vue
.
config
.
productionTip
=
false
App
.
mpType
=
'app'
const
app
=
new
Vue
({
...
App
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment