##Responding to Your question
This is good use of ref
ref
and Object.assign()
but normally this would be a good place to use a watched Property watched Property, or if you need to add dashes, a computed property computed property.
##Responding to Your question
This is good use of ref
and Object.assign()
but normally this would be a good place to use a watched Property, or if you need to add dashes, a computed property.
##Responding to Your question
This is good use of ref
and Object.assign()
but normally this would be a good place to use a watched Property, or if you need to add dashes, a computed property.
- 29.5k
- 16
- 45
- 202
That variable never gets re-assigned so to avoid accidental re-assignment, use const
instead of let
. There are some who recommend the following:
- use
const
by default
- only use
let
if rebinding is needed 1
There may not be much of a performance difference here although after reading some SO answers like this one and this one there is a potential but that might only be if a primitive type value (e.g. 42
) was used.
1https://mathiasbynens.be/notes/es6-const
That variable never gets re-assigned so to avoid accidental re-assignment, use const
instead of let
.
That variable never gets re-assigned so to avoid accidental re-assignment, use const
instead of let
. There are some who recommend the following:
- use
const
by default
- only use
let
if rebinding is needed 1
There may not be much of a performance difference here although after reading some SO answers like this one and this one there is a potential but that might only be if a primitive type value (e.g. 42
) was used.
1https://mathiasbynens.be/notes/es6-const
Take a look at the example below, which uses a watcher, instead of the @onchange
, which means that the method applyData()
can be eliminated:
Take a look at the example below, which uses a watcher:
Take a look at the example below, which uses a watcher, instead of the @onchange
, which means that the method applyData()
can be eliminated: