This commit is contained in:
tim
2025-01-16 20:17:03 -04:00
parent 19a8ffbbd4
commit 0545cd6e97
51 changed files with 482 additions and 436 deletions

View File

@@ -2,7 +2,7 @@
<v-tooltip :text="tooltip" location="top">
<template v-slot:activator="{ props }">
<v-btn v-bind="props" :color="isCurrent?'primary':undefined" variant="text"
:icon="icon" @click="()=>nav(route)"/>
:icon="icon" @click="click"/>
</template>
</v-tooltip>
</template>
@@ -12,9 +12,25 @@ import {computed} from "vue";
import {useRoute} from "vue-router";
import {nav} from "/src/misc.js"
const props = defineProps(['icon', 'route', 'tooltip'])
const props = defineProps(['icon', 'route', 'tooltip', 'href', 'target'])
const router = useRoute();
const isCurrent = computed(() => router.name === props.route)
function click() {
if (!props.href && !props.route)
console.warn('must set href or route in toolbar-button')
else if (props.href && props.route)
console.warn('cannot set both rout and href in toolbar-button')
else if (props.href) {
if (props.target)
window.open(props.href, props.target)
else
window.location.href = props.href
}
else
nav(props.route)
}
</script>
<style scoped lang="scss">