Declare or define reactive properties with $ sign. #7349
yogeshgalav
started this conversation in
Ideas
Replies: 1 comment 1 reply
-
There are currently experimental conversions. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
If we could declare or define reactive properties with $ sign it would look something like this
$my_variable = true;
would transform to
const my_variable = ref(true);
and
let new_variable = $my_variable
would transform to
let new_variable = my_variable.value
this syntactic sugar will have following advantages:
1.) Direct declaration of ref properties.
2.) Easy getter and setter for ref properties.
3.) Reduction of use of dot value.
4.) Reduction of use of ref and importing ref.
As a beginner to vue3 I feel no advantage of removing "this" and adding "value",
while from technical standpoint it does make complete sense,
but from beginner's standpoint it's very hard to learn and implement.
From technical perspective I don't have a valid point here but ref and reactive defies the very basic advantage of Vue, small learning curve.
Hence something should be done about it or vue will lose it popularity to svelte.
Beta Was this translation helpful? Give feedback.
All reactions