legacy-paperclip icon indicating copy to clipboard operation
legacy-paperclip copied to clipboard

Logic

Open crcn opened this issue 3 years ago • 0 comments


component TodoItem {
  render div {
    slot label
  }
}

component TodoList { 
  render foreach items as item {
    TodoItem(label: item.label)
  }
}

Alternatively:

component TodoList {
  render fragment {
  } repeat 
}

UI-wise, it might make sense to have a specific "repeat" block instead of having this as properties that can be applied to individual nodes. Same thing for things like "switch" blocks:

component Tabs {
  render match tab {
    "home" { 
      Home
    }
    "contact" {
      Contact
    }
  }
}

Presumably, tab

crcn avatar Aug 27 '22 17:08 crcn