Просмотр исходного кода

移动端不重新设置滚动条样式

任一存 2 лет назад
Родитель
Сommit
0588a55d75
2 измененных файлов с 7 добавлено и 3 удалено
  1. 5 3
      game/src/App.vue
  2. 2 0
      game/src/main.js

+ 5 - 3
game/src/App.vue

@@ -70,9 +70,11 @@ html, body {
 // }
 
 // 滚动条,只设置某一项可能导致不生效。
-::-webkit-scrollbar { background: #dddecc; width: 6px; height: 6px; }
-::-webkit-scrollbar-thumb { background: #828a5b; border-radius: 3px; }
-::-webkit-scrollbar-corner { background: #dddecc; }
+.not-mobile{
+  ::-webkit-scrollbar { background: #dddecc; width: 6px; height: 6px; }
+  ::-webkit-scrollbar-thumb { background: #828a5b; border-radius: 3px; }
+  ::-webkit-scrollbar-corner { background: #dddecc; }
+}
 
 // vue组件过渡效果
 .fade-out-leave-active {

+ 2 - 0
game/src/main.js

@@ -102,4 +102,6 @@ VueViewer.setDefaults({
 // 必须在vue根组件挂载之后执行
 if (uaInfo.device.type === 'mobile') {
   document.getElementById('app').classList.add('mobile')
+} else {
+  document.getElementById('app').classList.add('not-mobile')
 }