File tree 1 file changed +10
-4
lines changed
src/components/PageStrcture
1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change 1
1
<template >
2
2
<!-- User Footer -->
3
- <footer v-if =" text && text !== ''" v-html =" text" ></footer >
3
+ <footer v-if =" text && text !== ''" v-html =" text" :class = " !scrollVisible ? 'fixed' : '' " ></footer >
4
4
<!-- Default Footer -->
5
- <footer v-else >
5
+ <footer v-else :class = " !scrollVisible ? 'fixed' : '' " >
6
6
Developed by <a :href =" authorUrl" >{{authorName}}</a >.
7
7
Licensed under <a :href =" licenseUrl" >{{license}}</a >
8
8
{{ showCopyright? '©': '' }} {{date}}.
@@ -23,14 +23,19 @@ export default {
23
23
showCopyright: { type: Boolean , default: true },
24
24
repoUrl: { type: String , default: ' https://github.com/lissy93/dashy' },
25
25
},
26
+ data : () => ({
27
+ scrollVisible: false ,
28
+ }),
29
+ mounted () {
30
+ this .scrollVisible = document .body .clientHeight > window .innerHeight ;
31
+ },
26
32
};
27
33
</script >
28
34
29
35
<style scoped lang="scss">
30
36
31
37
footer {
32
- position : fixed ;
33
- width : 100% ;
38
+ width : calc (100% - 0.5rem );
34
39
bottom : 0 ;
35
40
padding : 0.25rem ;
36
41
text-align : center ;
@@ -39,6 +44,7 @@ footer {
39
44
background : var (--background-darker );
40
45
margin-top : 1.5rem ;
41
46
border-top : 1px solid var (--outline-color );
47
+ & .fixed { position : fixed ; }
42
48
}
43
49
44
50
footer a {
You can’t perform that action at this time.
0 commit comments