Closed farooqkz closed 4 years ago
@strukturart is currently in the process of migrating to vuejs
@farooqkz mustache looks interesting, do you have experience with it? because I've been trying to use vue.js for a while but just doesn't work with kaios
Yes from the time which I realized such a thing exist, I used it in almost every web application(Python + CherryPy, backend)! It's not hard to learn(at least the Python module was not)
i don't know how to create the array in the right form https://github.com/strukturart/bHacker-store-client/blob/bd68293b51dc347d31ea618052018ce7e630700f/application/app.js#L154
to loop across the array https://github.com/strukturart/bHacker-store-client/blob/3b718f7ce5b1770d6f290eb25874c405ea640ca9/application/app.js#L210
If your template is this:
{{#data}}
{{name}} is {{age}} years old.
{{/data}}
You should have data like this:
var some_array = [{name: "Far", age: 8}, {name: "perry", age: -1}];
var rendered = Mustache.render(template, {"data": some_array});
And you'll have:
Far is 8 years old.perry is -1 years old.
If you don't want to use vue.js please reconsider react/preact. @strukturart
At the cost of adding a dependency, the code will be shorter and more readable. https://mustache.github.io/