-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conditional rendering #46
Comments
As documented in #14 , pos-app-browser selects between hardcoded components based on type using pos-type-router and selectAppForTypes |
My understanding is that data modules define a custom js API that is then accessed through specific routes, i.e. properties of data are converted to routes rather than used directly https://github.com/pod-os/PodOS/blob/main/contacts/src/components/router/router.tsx |
In my experiments, I've found it useful to have
I note that Mavo allows a broad range of expressions |
The specific user interface needed is less clear. Here's a few options. Option 1
Fairly intuitive guard for a slot, but the attributes result in invalid RDFa when used with not, and else-if/else reasoning is difficult to express Option 2 It seems the router PodOS currently uses loads its children and then selectively renders them using stenciljs' usual jsx magic. Option 3 LWC uses attributes on template elements. This is would still need work on what the conditional looks like but wouldn't require code to specifically suppress display of light dom slots.
https://developer.salesforce.com/docs/platform/lwc/guide/create-conditional.html Option 4 Vaadin routes are defined declaratively in js. This is most similar to pos-type-router, i.e. instead of hardcoded types, it could somehow load an array of condition-component/uri combinations.
|
Combining options 1 and 3, my preferred option is currently <show-if>
<template if-typeof src>
<template else not if-property>
<template else> I've rejected Option 2 because the intent of templates is clearer than using slots and natively they are not rendered until needed. |
As someone building a dashboard, I want to change what is displayed based on properties of the data, without writing scripts.
The text was updated successfully, but these errors were encountered: