App.vue 1.1 KB

123456789101112131415161718192021222324252627282930313233
  1. <template>
  2. <div id="app">
  3. <router-view/>
  4. <portal-target name="notification-outlet"></portal-target>
  5. <portal-target name="notification-detail"></portal-target>
  6. <portal-target name="notification-search"></portal-target>
  7. <portal-target name="notification-usual"></portal-target>
  8. <portal-target name="notification-head"></portal-target>
  9. </div>
  10. </template>
  11. <script>
  12. export default {
  13. name:'App',
  14. mounted(){
  15. (/iphone|ipod|ipad/i.test(navigator.appVersion)) && document.addEventListener('blur', (e) => {
  16. // 这里加了个类型判断,因为a等元素也会触发blur事件
  17. if(['input', 'textarea'].includes(e.target.localName)) {
  18. // if(MobileDevice.getModels().join(' or ').indexOf('6') == -1){
  19. // document.activeElement.scrollIntoView({behavior: "smooth",block:'end'})
  20. // }
  21. setTimeout(()=> {
  22. document.scrollingElement.scrollTo(0, document.scrollingElement.scrollTop);
  23. }, 100);
  24. }
  25. }, true)
  26. },
  27. }
  28. </script>
  29. <style lang="less">
  30. @import "./less/index.less";
  31. </style>