mirror of
https://github.com/versia-pub/frontend.git
synced 2026-03-13 03:29:16 +01:00
refactor: ♻️ Refactor composer
This commit is contained in:
parent
70222d127b
commit
343765a331
8 changed files with 231 additions and 145 deletions
|
|
@ -25,28 +25,16 @@ defineOptions({
|
|||
});
|
||||
const props = defineProps<{
|
||||
maxCharacters?: number;
|
||||
modelContent: string;
|
||||
}>();
|
||||
|
||||
const emit = defineEmits<{
|
||||
"update:modelContent": [value: string];
|
||||
}>();
|
||||
const modelContent = defineModel<string>("modelContent", {
|
||||
required: true,
|
||||
});
|
||||
|
||||
const textarea = ref<HTMLTextAreaElement | undefined>(undefined);
|
||||
const { input: content } = useTextareaAutosize({
|
||||
element: textarea,
|
||||
input: props.modelContent,
|
||||
});
|
||||
|
||||
watch(
|
||||
() => props.modelContent,
|
||||
(value) => {
|
||||
content.value = value;
|
||||
},
|
||||
);
|
||||
|
||||
watch(content, (newValue) => {
|
||||
emit("update:modelContent", newValue);
|
||||
input: modelContent,
|
||||
});
|
||||
|
||||
const remainingCharacters = computed(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue