Files
fastmovieai/fastmovie-vue/src/components/xl-qrcode/index.vue
T
李建琦 eae151fd57 FastMovieAI AI短剧创作平台 二开基线
- 源码: xhadmincn/FastMovieAI (Apache 2.0)
- 二开: Docker部署, Swoole改Select, route.php修复, 补update/VERSION
- vendor/示例资源已gitignore
2026-08-26 18:37:36 +08:00

25 lines
607 B
Vue

<script lang="ts" setup>
import QRCode from "qrcode";
const props = withDefaults(defineProps<{
text?: string
size?: number
}>(), {
size: 200
});
const emit = defineEmits(['update'])
const qrcode = ref('');
watchEffect(() => {
qrcode.value = '';
if (props.text) {
QRCode.toDataURL(props.text, {
width: props.size
}, (_error: Error | null | undefined, url: string) => {
qrcode.value = url
emit('update');
});
}
})
</script>
<template>
<el-image v-if="qrcode" :src="qrcode" style="width: 100%;height: 100%;" />
</template>