fluorjs / fluor

Sprinkle interactivity on your design
https://fluorjs.github.io/
223 stars 6 forks source link

What happens when a template has both f-if and f-each? #12

Closed madx closed 4 years ago

madx commented 4 years ago

Probably a mess as of 0.4.0!

Either we have f-if take precedence over f-each and that would cancel the iteration, or we forbid to have both tags and the user must use a separate <template> tag for each of them:

<template f-if="shown">
  <template f-each="value in values">
madx commented 4 years ago

I added an example about this: https://github.com/fluorjs/fluor/blob/master/examples.html#L165-L171

madx commented 4 years ago

I think the code should remain simple for now and that we should not enforce it on the lib side, let's trust the user. This might however be addressed within #21