Skip to main content
Code Review

Return to Answer

replaced https://vuejs.org/v2 with https://v2.vuejs.org/v2
Source Link

##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.

expand section on const/let, mention performance
Source Link

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

justify alternative
Source Link

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:

Source Link
Loading
lang-js

AltStyle によって変換されたページ (->オリジナル) /