|
@@ -1,38 +1,38 @@
|
|
|
-<template>
|
|
|
- <div class="login-scan-container">
|
|
|
- <div ref="qrcodeRef"></div>
|
|
|
- <div class="font12 mt20 login-msg">{{ $t('message.scan.text') }}</div>
|
|
|
- </div>
|
|
|
-</template>
|
|
|
-
|
|
|
<script lang="ts">
|
|
|
import { ref, defineComponent, onMounted } from 'vue';
|
|
|
import QRCode from 'qrcodejs2-fixes';
|
|
|
|
|
|
export default defineComponent({
|
|
|
- name: 'loginScan',
|
|
|
- setup() {
|
|
|
- const qrcodeRef = ref<HTMLElement | null>(null);
|
|
|
- // 初始化生成二维码
|
|
|
- const initQrcode = () => {
|
|
|
- (qrcodeRef.value as HTMLElement).innerHTML = '';
|
|
|
- new QRCode(qrcodeRef.value, {
|
|
|
- text: `https://jq.qq.com/?_wv=1027&k=hUu2GeU1`,
|
|
|
- width: 260,
|
|
|
- height: 260,
|
|
|
- colorDark: '#000000',
|
|
|
- colorLight: '#ffffff',
|
|
|
- });
|
|
|
- };
|
|
|
- // 页面加载时
|
|
|
- onMounted(() => {
|
|
|
- initQrcode();
|
|
|
- });
|
|
|
- return { qrcodeRef };
|
|
|
- },
|
|
|
+ name: 'loginScan',
|
|
|
+ setup() {
|
|
|
+ const qrcodeRef = ref<HTMLElement | null>(null);
|
|
|
+ // 初始化生成二维码
|
|
|
+ const initQrcode = () => {
|
|
|
+ (qrcodeRef.value as HTMLElement).innerHTML = '';
|
|
|
+ new QRCode(qrcodeRef.value, {
|
|
|
+ text: `https://jq.qq.com/?_wv=1027&k=hUu2GeU1`,
|
|
|
+ width: 260,
|
|
|
+ height: 260,
|
|
|
+ colorDark: '#000000',
|
|
|
+ colorLight: '#ffffff',
|
|
|
+ });
|
|
|
+ };
|
|
|
+ // 页面加载时
|
|
|
+ onMounted(() => {
|
|
|
+ initQrcode();
|
|
|
+ });
|
|
|
+ return { qrcodeRef };
|
|
|
+ },
|
|
|
});
|
|
|
</script>
|
|
|
|
|
|
+<template>
|
|
|
+ <div class="login-scan-container">
|
|
|
+ <div ref="qrcodeRef"></div>
|
|
|
+ <div class="font12 mt20 login-msg">{{ $t('message.scan.text') }}</div>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
<style scoped lang="scss">
|
|
|
.login-scan-animation {
|
|
|
opacity: 0;
|