提交 | 用户 | 时间
|
820397
|
1 |
<template> |
H |
2 |
<ContentWrap class="w-300px h-full mb-[0!important]"> |
|
3 |
<el-radio-group v-model="generateMode" class="mb-15px"> |
|
4 |
<el-radio-button label="desc"> |
|
5 |
描述模式 |
|
6 |
</el-radio-button> |
|
7 |
<el-radio-button label="lyric"> |
|
8 |
歌词模式 |
|
9 |
</el-radio-button> |
|
10 |
</el-radio-group> |
|
11 |
|
|
12 |
<!-- 描述模式/歌词模式 切换 --> |
|
13 |
<component :is="generateMode === 'desc' ? desc : lyric" ref="modeRef"/> |
|
14 |
|
|
15 |
<el-button type="primary" round class="w-full" @click="generateMusic"> |
|
16 |
创作音乐 |
|
17 |
</el-button> |
|
18 |
</ContentWrap> |
|
19 |
</template> |
|
20 |
|
|
21 |
<script lang="ts" setup> |
|
22 |
import desc from './desc.vue' |
|
23 |
import lyric from './lyric.vue' |
|
24 |
|
|
25 |
defineOptions({ name: 'Index' }) |
|
26 |
|
|
27 |
const emits = defineEmits(['generate-music']) |
|
28 |
|
|
29 |
const generateMode = ref('lyric') |
|
30 |
|
|
31 |
const modeRef = ref<Nullable<{ formData: Recordable }>>(null) |
|
32 |
|
|
33 |
/* |
|
34 |
*@Description: 根据信息生成音乐 |
|
35 |
*@MethodAuthor: xiaohong |
|
36 |
*@Date: 2024-06-27 16:40:16 |
|
37 |
*/ |
|
38 |
function generateMusic () { |
|
39 |
emits('generate-music', {formData: unref(modeRef)?.formData}) |
|
40 |
} |
|
41 |
</script> |