bx-2502-qr #1
18
pages/qr.vue
18
pages/qr.vue
|
@ -1,6 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="qr-container">
|
<div class="qr-container">
|
||||||
<h1 class="qr-title">QR-код</h1>
|
<h1 class="qr-title">QR-КОД</h1>
|
||||||
<canvas ref="qrCanvas" class="qr-code"></canvas>
|
<canvas ref="qrCanvas" class="qr-code"></canvas>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
@ -12,10 +12,13 @@ export default {
|
||||||
name: 'QRPage',
|
name: 'QRPage',
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
qrText: 'http://192.168.88.153:8106/',
|
qrText: '', // Текст или ссылка для QR-кода
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
// Добавляем "https://", если его нет в URL
|
||||||
|
const currentUrl = window.location.href;
|
||||||
|
this.qrText = currentUrl.startsWith('http') ? currentUrl : `https://${currentUrl}`;
|
||||||
this.generateQR();
|
this.generateQR();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
@ -43,12 +46,11 @@ export default {
|
||||||
}
|
}
|
||||||
|
|
||||||
.qr-title {
|
.qr-title {
|
||||||
font-family: 'Arial', sans-serif; /* Шрифт */
|
font-family: 'Arial', sans-serif;
|
||||||
font-size: 2.5rem; /* Размер текста */
|
font-size: 2rem;
|
||||||
color: #333; /* Цвет текста */
|
color: #333;
|
||||||
font-weight: bold; /* Жирный текст */
|
font-weight: bold;
|
||||||
text-transform: uppercase; /* Все буквы заглавные */
|
margin-bottom: 20px;
|
||||||
margin-bottom: 0px; /* Отступ снизу */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.qr-code {
|
.qr-code {
|
||||||
|
|
Loading…
Reference in New Issue