Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
ycc-website
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Website
ycc-website
Commits
daf0feb4
Commit
daf0feb4
authored
May 13, 2021
by
hanfeng zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
099f86c4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
32 additions
and
37 deletions
+32
-37
index.vue
src/layouts/index.vue
+11
-1
main.ts
src/main.ts
+1
-31
style.css
src/style.css
+13
-2
Home.vue
src/views/Home.vue
+7
-3
No files found.
src/layouts/index.vue
View file @
daf0feb4
<
template
>
<div
class=
"Layout"
>
<div
class=
"Layout
"
>
<!--
<header>
header
</header>
-->
<div
class=
'content'
>
<slot>
...
...
@@ -17,3 +17,12 @@ export default Vue.extend({
name
:
'Layout'
});
</
script
>
<
style
scoped
>
.Layout
{
height
:
100%
;
width
:
100%
;
position
:
relative
;
overflow-y
:
scroll
;
overflow-x
:
hidden
;
}
</
style
>
\ No newline at end of file
src/main.ts
View file @
daf0feb4
...
...
@@ -5,37 +5,7 @@ import store from './store'
import
'./style.css'
Vue
.
config
.
productionTip
=
false
const
overscroll
=
function
(
el
:
any
)
{
el
.
addEventListener
(
'touchstart'
,
function
()
{
const
top
=
el
.
scrollTop
,
totalScroll
=
el
.
scrollHeight
,
currentScroll
=
top
+
el
.
offsetHeight
;
//If we're at the top or the bottom of the containers
//scroll, push up or down one pixel.
//
//this prevents the scroll from "passing through" to
//the body.
if
(
top
===
0
)
{
el
.
scrollTop
=
1
;
}
else
if
(
currentScroll
===
totalScroll
)
{
el
.
scrollTop
=
top
-
1
;
}
});
el
.
addEventListener
(
'touchmove'
,
function
(
evt
:
any
)
{
//if the content is actually scrollable, i.e. the content is long enough
//that scrolling can occur
if
(
el
.
offsetHeight
<
el
.
scrollHeight
)
evt
.
_isScroller
=
true
;
});
}
overscroll
(
document
.
querySelector
(
'.scroll'
));
document
.
body
.
addEventListener
(
'touchmove'
,
function
(
evt
:
any
)
{
//In this case, the default behavior is scrolling the body, which
//would result in an overflow. Since we don't want that, we preventDefault.
if
(
!
evt
.
_isScroller
)
{
evt
.
preventDefault
();
}
});
new
Vue
({
router
,
store
,
...
...
src/style.css
View file @
daf0feb4
@tailwind
base
;
@tailwind
components
;
@tailwind
utilities
;
body
,
html
{
body
{
background-color
:
red
;
width
:
100vw
;
height
:
100vh
;
position
:
fixed
;
top
:
0
;
left
:
0
;
overflow
:
hidden
;
}
#app
{
height
:
100%
;
width
:
100%
;
}
\ No newline at end of file
src/views/Home.vue
View file @
daf0feb4
<
template
>
<div
class=
"home relative overflow-scroll"
>
<div
class=
'page bg-red-600'
></div>
<div
class=
'page bg-blue-600'
></div>
<div
class=
"home overflow-y-scroll"
>
<div
class=
'page bg-red'
>
dfkl
</div>
<div
class=
'page bg-blue-600'
>
sdafkljsdlfjlksd
</div>
</div>
</
template
>
...
...
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