Petre-Gabriel / greenlight

A minimal JavaScript framework for boosting production on small-scale web projects.
https://gl.petregabriel.ro
0 stars 0 forks source link

You can't use nested objects with gl-for #11

Closed Petre-Gabriel closed 8 months ago

Petre-Gabriel commented 8 months ago

Found this while working on a personal project - should change the if statement for the key updated to match all cases ( the same logic used in all the other directives )

Here is a fictive code based on my project:

const QuizQuestions = [
        {
          text: "What is the capital of France?",
          answers: [
            { text: "Paris", correct: true },
            { text: "London", correct: false },
            { text: "Rome", correct: false },
            { text: "Madrid", correct: false },
          ],
        },
];
QuizController.$store.set("currentQuestion", QuizQuestions[0]);
<template gl-test gl-for="answer,idx in currentQuestion.answers">
    <li gl-bind="answer.text"></li>
</template>