diff --git a/src/components/guide/index.js b/src/components/guide/index.js index 562fa96..a33c51a 100644 --- a/src/components/guide/index.js +++ b/src/components/guide/index.js @@ -2,25 +2,26 @@ import { transform, i18n, lan } from '../../unit/const' import { isMobile } from '../../unit' export default { name: 'Guide', - data(){ - return { - isMobile:isMobile() - } + data() { + return { + isMobile: isMobile() + } }, computed: { linkTitle: () => i18n.linkTitle[lan], github: () => i18n.github[lan], QRCode: () => i18n.QRCode[lan], QRTitle: () => i18n.QRNotice[lan], - QRSrc: () => "http://binaryify.github.io/vue-tetris/static/qr.jpeg" - + QRSrc: () => + window.location.protocol + + '//binaryify.github.io/vue-tetris/static/qr.jpeg' }, - mounted(){ + mounted() { window.addEventListener('resize', this.resize.bind(this), true) }, - methods:{ - resize(){ - this.isMobile=isMobile() + methods: { + resize() { + this.isMobile = isMobile() } } }