Код: Выделить всё
import { reactive } from 'vue'
import { Link } from "@inertiajs/vue3";
defineProps({
post: Array
});
const form = reactive({
title: this.post.title, //Error - TypeError: Cannot read properties of undefined (reading 'post')
content: this.post.content
});
function submit() {
// router.post('/posts', form)
}
Нужно, чтобы данные в форме на странице были заполнены данными из переменной "post".
пробовал так:
Код: Выделить всё
defineProps({
post: Object
});
const form = reactive({
title: post.title,
content: post.content
});
Подробнее здесь: https://stackoverflow.com/questions/790 ... t-from-pro