2023-01-19 05:44:06 +00:00
|
|
|
<template>
|
|
|
|
<div class="dropdown dropdown-left">
|
|
|
|
<slot>
|
|
|
|
<label tabindex="0" class="btn btn-circle btn-sm">
|
2024-03-01 01:20:18 +00:00
|
|
|
<MdiQrcode />
|
2023-01-19 05:44:06 +00:00
|
|
|
</label>
|
|
|
|
</slot>
|
|
|
|
<div tabindex="0" class="card compact dropdown-content shadow-lg bg-base-100 rounded-box w-64">
|
|
|
|
<div class="card-body">
|
|
|
|
<h2 class="text-center">Page URL</h2>
|
|
|
|
<img :src="getQRCodeUrl()" />
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
2023-07-23 04:11:29 +00:00
|
|
|
import { route } from "../../lib/api/base";
|
2024-03-01 01:20:18 +00:00
|
|
|
import MdiQrcode from "~icons/mdi/qrcode";
|
2023-07-23 04:11:29 +00:00
|
|
|
|
2023-01-19 05:44:06 +00:00
|
|
|
function getQRCodeUrl(): string {
|
|
|
|
const currentURL = window.location.href;
|
|
|
|
|
2023-07-23 04:11:29 +00:00
|
|
|
return route(`/qrcode`, { data: encodeURIComponent(currentURL) });
|
2023-01-19 05:44:06 +00:00
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped></style>
|