-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Implement dynamic components #971
Conversation
|
Codecov Report
@@ Coverage Diff @@
## master #971 +/- ##
==========================================
- Coverage 91.94% 91.86% -0.08%
==========================================
Files 112 112
Lines 4110 4169 +59
Branches 1332 1363 +31
==========================================
+ Hits 3779 3830 +51
- Misses 143 144 +1
- Partials 188 195 +7
Continue to review full report at Codecov.
|
Think this is basically done. I renamed |
<:Component> is better than <:Switch> (and as a plus, matches vue syntax for people coming from vue), but <:Dynamic>(or something similar) is better/less confusing imho than a common keyword such as Component |
+1 for |
gah, it's shipped already! let's sit with it a while, see if |
I still prefer |
fwiw - i also prefer |
Only part-way there, but progress is being made:
:Switch
is by no means final —:Component
was another suggestion.The idea is that the component is a placeholder for whatever the value of
x ? Foo : Bar
is (this could be any expression, including computed or store properties, etc). Whenever the value of the expression changes, the existing instance is removed, and a new one is created.Still to do:
and whatever has so far escaped my attention.
This will enable lots of different things, like lazy-loading components, switching components based on route, lists of different types of things (think of a Twitter client, where a different component is used to render media tweets, for example), and so on.
If anyone hates the syntax, say so!