You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/v2/guide/migration.md
+23-23
Original file line number
Diff line number
Diff line change
@@ -210,15 +210,15 @@ The implicitly assigned `$index` and `$key` variables have been removed in favor
210
210
211
211
`track-by` has been replaced with `key`, which works like any other attribute: without the `v-bind:` or `:` prefix, it is treated as a literal string. In most cases, you'd want to use a dynamic binding which expects a full expression instead of a key. For example, in place of:
212
212
213
-
```html
213
+
{% codeblock lang:html %}
214
214
<divv-for="item in items"track-by="id">
215
-
```
215
+
{% endcodeblock %}
216
216
217
217
You would now write:
218
218
219
-
```html
219
+
{% codeblock lang:html %}
220
220
<divv-for="item in items"v-bind:key="item.id">
221
-
```
221
+
{% endcodeblock %}
222
222
223
223
{% raw %}
224
224
<divclass="upgrade-path">
@@ -400,9 +400,9 @@ For enumerated attributes, in addition to the falsy values above, the string `"f
400
400
401
401
When used on a component, `v-on` now only listens to custom events `$emit`ted by that component. To listen for a native DOM event on the root element, you can use the `.native` modifier. For example:
@@ -1070,9 +1070,9 @@ function pluralizeKnife (count) {
1070
1070
1071
1071
For a very naive implementation, you could do something like this:
1072
1072
1073
-
```js
1073
+
{% codeblock lang:js %}
1074
1074
'$' + price.toFixed(2)
1075
-
```
1075
+
{% endcodeblock %}
1076
1076
1077
1077
In many cases though, you'll still run into strange behavior (e.g. `0.035.toFixed(2)` rounds up to `0.04`, but `0.045` rounds down to `0.04`). To work around these issues, you can use the [`accounting`](http://openexchangerates.github.io/accounting.js/) library to more reliably format currencies.
1078
1078
@@ -1365,9 +1365,9 @@ Instead, retrieve reactive data directly.
0 commit comments