Run prettier
This commit is contained in:
@@ -13,7 +13,7 @@ const router = useRouter()
|
|||||||
const isMenuActive = ref(false)
|
const isMenuActive = ref(false)
|
||||||
const isSearchBarShown = ref(false)
|
const isSearchBarShown = ref(false)
|
||||||
|
|
||||||
const appVersion = import.meta.env.VITE_APP_VERSION;
|
const appVersion = import.meta.env.VITE_APP_VERSION
|
||||||
|
|
||||||
function logout() {
|
function logout() {
|
||||||
authStore.logout()
|
authStore.logout()
|
||||||
@@ -47,7 +47,14 @@ onMounted(() => {
|
|||||||
<template>
|
<template>
|
||||||
<nav class="navbar">
|
<nav class="navbar">
|
||||||
<div class="navbar-brand">
|
<div class="navbar-brand">
|
||||||
<RouterLink to="/" class="navbar-item" :title="'bibliomane v' + appVersion" activeClass="is-active"> B </RouterLink>
|
<RouterLink
|
||||||
|
to="/"
|
||||||
|
class="navbar-item"
|
||||||
|
:title="'bibliomane v' + appVersion"
|
||||||
|
activeClass="is-active"
|
||||||
|
>
|
||||||
|
B
|
||||||
|
</RouterLink>
|
||||||
<div class="navbar-item is-hidden-desktop">
|
<div class="navbar-item is-hidden-desktop">
|
||||||
<a
|
<a
|
||||||
@click="isSearchBarShown = !isSearchBarShown"
|
@click="isSearchBarShown = !isSearchBarShown"
|
||||||
|
|||||||
@@ -125,8 +125,10 @@ function goToAuthor() {
|
|||||||
</div>
|
</div>
|
||||||
<div class="column">
|
<div class="column">
|
||||||
<div class="iconscontainer" :class="data.read ? 'remove-border-bottom' : ''">
|
<div class="iconscontainer" :class="data.read ? 'remove-border-bottom' : ''">
|
||||||
<div class="bigiconcontainer"
|
<div
|
||||||
:class="data.wantread ? 'has-text-dark has-background-text border-radius-up-fill' : ''">
|
class="bigiconcontainer"
|
||||||
|
:class="data.wantread ? 'has-text-dark has-background-text border-radius-up-fill' : ''"
|
||||||
|
>
|
||||||
<BigIcon
|
<BigIcon
|
||||||
icon="BIconEye"
|
icon="BIconEye"
|
||||||
:legend="$t('bookform.wantread')"
|
:legend="$t('bookform.wantread')"
|
||||||
|
|||||||
@@ -1,39 +1,37 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import { useTemplateRef, onMounted, onUnmounted, ref } from 'vue'
|
import { useTemplateRef, onMounted, onUnmounted, ref } from 'vue'
|
||||||
import { BrowserMultiFormatReader } from '@zxing/library'
|
import { BrowserMultiFormatReader } from '@zxing/library'
|
||||||
import { i18n } from "@/main";
|
import { i18n } from '@/main'
|
||||||
|
|
||||||
const emit = defineEmits('readBarcode')
|
const emit = defineEmits('readBarcode')
|
||||||
|
|
||||||
const { t } = i18n.global;
|
const { t } = i18n.global
|
||||||
|
|
||||||
const scanResult = ref(null);
|
const scanResult = ref(null)
|
||||||
const scanErr = ref(null);
|
const scanErr = ref(null)
|
||||||
const codeReader = new BrowserMultiFormatReader();
|
const codeReader = new BrowserMultiFormatReader()
|
||||||
const scannerElement = useTemplateRef('scanner');
|
const scannerElement = useTemplateRef('scanner')
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
if (!codeReader.isMediaDevicesSuported || !codeReader.canEnumerateDevices) {
|
if (!codeReader.isMediaDevicesSuported || !codeReader.canEnumerateDevices) {
|
||||||
scanErr.value = "This browser does not support this feature.";
|
scanErr.value = 'This browser does not support this feature.'
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
codeReader.listVideoInputDevices()
|
codeReader.listVideoInputDevices().then((mediaDevicesInfoArray) => {
|
||||||
.then((mediaDevicesInfoArray) => {
|
|
||||||
if (mediaDevicesInfoArray.length > 0) {
|
if (mediaDevicesInfoArray.length > 0) {
|
||||||
codeReader.decodeFromVideoDevice(undefined, scannerElement.value, (result, err) => {
|
codeReader.decodeFromVideoDevice(undefined, scannerElement.value, (result, err) => {
|
||||||
if (result) {
|
if (result) {
|
||||||
emit('readBarcode', result.text);
|
emit('readBarcode', result.text)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
scanErr.value = t('barcode.nocamera');
|
scanErr.value = t('barcode.nocamera')
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
onUnmounted(() => {
|
onUnmounted(() => {
|
||||||
codeReader.reset();
|
codeReader.reset()
|
||||||
})
|
})
|
||||||
function onResult(result) {
|
function onResult(result) {
|
||||||
scanResult.value = result
|
scanResult.value = result
|
||||||
|
|||||||
Reference in New Issue
Block a user