I work with VUE CLI and I want to build a entry form. My first Idea to bind in the data was props. They work but i can't modify the data (because it's props :D). To correctly integrate the data, my second idea was to import a JSON File to the data.

So my questions are: Is it possible to save a entry automatically as a JSON File? Is there a better solution to binding the entry content to the VUE data? How can i create a Entry Form with JSON? I can put out a table with |json_encode – is it possible to change this json and to safe it?

Many Thanks!

  • 1
    You could just pass the prop to a data object (in vue), and there you go, you can modify it. This certainly works for smallish sets of data. If you are working with lots of complex data, look into the Element API or CraftQL.
    – Udo
    Jul 29, 2019 at 7:09
  • Correct. This works. Is it possible to edit a json created with Element API via vue? Because i want to build a entry form…
    – Markus
    Jul 29, 2019 at 20:24
  • The Element API is read-only. If you need your entry form to work via ajax, you can target the same controller end-points given in the entry form examples in the docs. Axios works great. If you don't mind the page refresh a regular form submit will also do.
    – Udo
    Jul 31, 2019 at 11:15


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.