71 lines
1.3 KiB
Vue
71 lines
1.3 KiB
Vue
<template>
|
|
<div class="field">
|
|
<div class="box">
|
|
<h2 class="title">{{ $t('luma.name.prompt') }}</h2>
|
|
<info-icon :content="$t('luma.description.prompt')" class="info" />
|
|
</div>
|
|
<el-input
|
|
v-model="prompt"
|
|
:rows="3"
|
|
type="textarea"
|
|
class="prompt"
|
|
:placeholder="$t('luma.placeholder.prompt')"
|
|
:maxlength="300"
|
|
show-word-limit
|
|
/>
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
import { defineComponent } from 'vue';
|
|
import { ElInput } from 'element-plus';
|
|
import InfoIcon from '@/components/common/InfoIcon.vue';
|
|
|
|
export const DEFAULT_PROMPT = '';
|
|
|
|
export default defineComponent({
|
|
name: 'PromptInput',
|
|
components: {
|
|
ElInput,
|
|
InfoIcon
|
|
},
|
|
data() {
|
|
return {};
|
|
},
|
|
computed: {
|
|
prompt: {
|
|
get() {
|
|
return this.$store.state.suno?.config?.prompt;
|
|
},
|
|
set(val) {
|
|
console.debug('set prompt', val);
|
|
this.$store.commit('suno/setConfig', {
|
|
...this.$store.state.suno?.config,
|
|
prompt: val
|
|
});
|
|
}
|
|
}
|
|
},
|
|
mounted() {
|
|
if (!this.value) {
|
|
this.value = DEFAULT_PROMPT;
|
|
}
|
|
}
|
|
});
|
|
</script>
|
|
|
|
<style lang="scss" scoped>
|
|
.field {
|
|
.box {
|
|
display: flex;
|
|
flex-direction: row;
|
|
align-items: center;
|
|
position: relative;
|
|
.title {
|
|
font-size: 14px;
|
|
margin-bottom: 10px;
|
|
}
|
|
}
|
|
}
|
|
</style>
|