feat [api]: actor input component (one per line)

This commit is contained in:
Alice 2023-01-29 00:07:44 +01:00
parent 05affca69d
commit 0a18c8b312

View file

@ -1,5 +1,23 @@
<template></template>
<template>
<textarea v-model="actorsText" class="textarea" :rows="rows" />
</template>
<script setup lang="ts"></script>
<script setup lang="ts">
import { PropType } from "@vue/runtime-core"
<style scoped lang="sass"></style>
const props = defineProps({
modelValue: { type: Array as PropType<string[]>, required: true },
rows: { type: Number, default: 5 },
})
const emits = defineEmits(["update:modelValue"])
const actorsText = computed<string>({
get() {
return props.modelValue.join("\n")
},
set(value) {
const array = value.split("\n")
emits(`update:modelValue`, array)
},
})
</script>