@@ -148,16 +148,28 @@ export default {
148148 this .$nextTick (() => {
149149 this .clipboard = new Clipboard (' .copy-btn' )
150150 this .clipboard .on (' success' , (e ) => {
151- this .$message .success (' 复制成功' )
151+ this .$message ({
152+ message: ' 复制成功' ,
153+ type: ' success' ,
154+ offset: 80
155+ })
152156 })
153157 this .clipboard .on (' error' , (e ) => {
154- this .$message .error (' 复制成功失败' )
158+ this .$message ({
159+ message: ' 复制失败' ,
160+ type: ' error' ,
161+ offset: 80
162+ })
155163 })
156164 })
157- window .addEventListener (' scroll' , this .pageScroll , false )
165+ if (document .documentElement .clientWidth > 1590 ) {
166+ window .addEventListener (' scroll' , this .pageScroll , false )
167+ }
158168 },
159169 beforeDestroy () {
160- window .removeEventListener (' scroll' , this .pageScroll , false )
170+ if (document .documentElement .clientWidth > 1590 ) {
171+ window .removeEventListener (' scroll' , this .pageScroll , false )
172+ }
161173 },
162174 methods: {
163175 async apiArticleDetailMethod () {
@@ -190,7 +202,8 @@ export default {
190202 if (result .isok ) {
191203 this .$message ({
192204 message: ' Add star success' ,
193- type: ' success'
205+ type: ' success' ,
206+ offset: 80
194207 })
195208 this .info .articleStart = result .data .articleStart
196209 }
@@ -240,8 +253,17 @@ export default {
240253 top : 80px ;
241254 left : 50% ;
242255 z-index : 100 ;
256+ padding-top : 26px ;
243257 margin-left : 575px ;
244- max-width : 200px ;
258+ max-width : 220px ;
259+ max-height : calc (100vh - 168px );
260+ overflow-y : auto ;
261+ & ::before {
262+ position : fixed ;
263+ top : 80px ;
264+ width : 220px ;
265+ background-color : #fff ;
266+ }
245267 }
246268}
247269.article-content {
0 commit comments