This commit is contained in:
Alex Ziskind 2021-11-26 14:56:05 -05:00
Родитель 2e7ef86d32
Коммит 7350780ef8
1 изменённых файлов: 3 добавлений и 5 удалений

Просмотреть файл

@ -51,11 +51,8 @@ export default defineComponent({
comments: Array as PropType<PtComment[]>,
currentUser: Object as PropType<PtUser>,
},
setup() {
setup(props, context) {
const newCommentText = ref(EMPTY_STRING);
const addNewComment = (newComment: PtNewComment) => {
console.log("add new comment" + newComment);
};
const onAddTapped = () => {
const newTitle = newCommentText.value.trim();
@ -65,7 +62,8 @@ export default defineComponent({
const newComment: PtNewComment = {
title: newTitle,
};
addNewComment(newComment);
context.emit("addNewComment", newComment);
newCommentText.value = EMPTY_STRING;
};