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