Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: Regarding the use of personal templates #127

Open
ashleyyy94 opened this issue Apr 19, 2024 · 1 comment
Open

Question: Regarding the use of personal templates #127

ashleyyy94 opened this issue Apr 19, 2024 · 1 comment

Comments

@ashleyyy94
Copy link

Hi there, first of all thank you for this awesome project! I'm interested in adding my own templates to edit as a base. However, I realise it is not just about uploading a cover image to start editing.

When clicking on a template to start editing, the response from the API call contains id, cover, title, width, height etc. What I'm interested in is the "data" key. What is the data structure, or how do you set the values for this "data" attribute in order to get the template editing working?

Thank you very much :)

@palxiao
Copy link
Owner

palxiao commented Apr 19, 2024

Hello, thank you for liking! This project is planned to be updated for a long time, welcome to add star 😁

As for the problem you mentioned, this data structure is mainly processed and applied in the front end. For the API, it is just a serialized JSON data, which is saved to the server after being generated in the front end.

The specific data structure can be viewed in the src/store/widget of the code, they create by Pinia, like this:

image

So add a template just save those data (created on the front end) to the server.

There have been some changes in the data structure to support the cause of "multi artboards". I just recently drew a graph, it should be able to help you better understand:

image

Currently, both data structures are compatible. certainly, they both processed on the front end.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants