FastMovieAI AI短剧创作平台 二开基线
- 源码: xhadmincn/FastMovieAI (Apache 2.0) - 二开: Docker部署, Swoole改Select, route.php修复, 补update/VERSION - vendor/示例资源已gitignore
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
<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>
|
||||
Reference in New Issue
Block a user