Answer the question
In order to leave comments, you need to log in
How to make a "smart" script?
There is a test, 5 tasks for traffic rules. Processing the correctness of the answer goes to js. There is a template (twig) - it is common for all 5 pages. But each page has its own js handler. How can this handler be dynamically loaded depending on the page? I have just started learning Vue - I will be grateful if you tell me how to implement it.
Answer the question
In order to leave comments, you need to log in
As an option, implement the component responsible for the task, pass the data for the task there through props and generate an event when the user responds to this task with the response object. In the parent component, process the event through the desired handler, switch to the next task, etc...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question