Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
JuyuanPrimarySchool
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
vue-project
JuyuanPrimarySchool
Commits
c5947dea
Commit
c5947dea
authored
Jul 19, 2021
by
zsh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改App.vue
parent
46ab1237
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
28 deletions
+11
-28
runner
runner
+1
-1
App.vue
src/App.vue
+10
-27
No files found.
runner
@
9ce9836f
Subproject commit
25a10e17bcef2d7bb93902088f9f46371801e0d5
Subproject commit
9ce9836f46d3271f3f82ad8011b90c838afa4d6c
src/App.vue
View file @
c5947dea
<
template
>
<div
id=
"app"
>
<div
id=
"app"
:style=
"
{width: designWidth + 'px', height: designHeight + 'px'}"
>
<router-view></router-view>
</div>
</
template
>
<
script
>
import
{
refreshScale
}
from
'runner/common/utils/refreshSize'
import
utils
from
'utils'
import
setScale
from
'runner/common/utils/refreshSize'
export
default
{
name
:
'app'
,
mixins
:
[
setScale
],
data
()
{
return
{
designWidth
:
384
0
,
// 设计稿宽度
designHeight
:
216
0
// 设计稿高度
designWidth
:
192
0
,
// 设计稿宽度
designHeight
:
108
0
// 设计稿高度
}
},
...
...
@@ -23,31 +26,14 @@ export default {
bodyStyle
.
overflow
=
'auto'
// 如无需设置自动适配则注释该方法即可
this
.
initScale
()
this
.
initScale
(
this
.
designWidth
,
this
.
designHeight
)
},
methods
:
{
/**
* @method initScale 设置页面缩放事件
*/
initScale
()
{
const
appStyle
=
document
.
getElementById
(
'app'
).
style
appStyle
.
position
=
'fixed'
refreshScale
(
this
.
designWidth
,
this
.
designHeight
)
// 窗口缩放时重新做适配
window
.
addEventListener
(
'resize'
,
utils
.
throttle
(()
=>
{
refreshScale
(
this
.
designWidth
,
this
.
designHeight
)
},
false
))
}
}
methods
:
{}
}
</
script
>
<
style
lang=
"less"
>
@designWidth
:
1920px
;
@designHeight
:
1080px
;
body
{
background-color
:
#011428
;
}
...
...
@@ -57,11 +43,8 @@ body {
left
:
50%
;
right
:
0
;
bottom
:
0
;
width
:
@
designWidth
;
height
:
@
designHeight
;
overflow
:
hidden
;
user-select
:
none
;
background-size
:
@
designWidth
@
designHeight
;
background-position
:
center
bottom
;
}
</
style
>
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