Skip to content

Commit

Permalink
fix: 桌面端 通过 vue-route 跳转报错
Browse files Browse the repository at this point in the history
  • Loading branch information
arnan-wei committed May 6, 2020
1 parent 531fd34 commit 20e09d2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/components/client/Page.vue
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,12 @@
const query = document.querySelector.bind(document)
if (window.isDesktop) {
if (forDesktop) {
query('#desktop-bg').remove()
query('body').replaceChild(query('#app'), query('#app-wrapper'))
Promise.resolve(query('#desktop-bg')).then(t => t && t.remove())
Promise.all([query('#app'), query('#app-wrapper')]).then(([app, wrapper]) => app && wrapper && query('body').replaceChild(app, wrapper))
} else {
var $appFixed = query('#app-fixed')
var $appWrapper = query('#app-wrapper')
if (!$appFixed || !$appWrapper) return
var scale = 320 / width
$appWrapper.style.width = $appWrapper.clientWidth / scale + 'px'
$appWrapper.style.height = $appWrapper.clientHeight / scale + 'px'
Expand Down

0 comments on commit 20e09d2

Please sign in to comment.