App.vue 996 B

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