Skip to content

Commit

Permalink
Merge pull request #473 from AleksandrDronov/patch-1
Browse files Browse the repository at this point in the history
add block for options api
  • Loading branch information
Ibochkarev authored Aug 13, 2024
2 parents 5ff3f87 + af80010 commit 4521a10
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/guide/essentials/list.md
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,19 @@ methods: {

Обратите внимание на использование `reverse()` и `sort()` в вычисляемых свойствах! Эти два метода изменят исходный массив, а этого следует избегать в геттерах вычисляемых свойств. Поэтому перед вызовом этих методов создайте копию исходного массива:

<div class="composition-api">

```diff
- return numbers.reverse()
+ return [...numbers].reverse()
```

</div>
<div class="options-api">

```diff
- return this.numbers.reverse()
+ return [...this.numbers].reverse()
```

</div>

1 comment on commit 4521a10

@vercel
Copy link

@vercel vercel bot commented on 4521a10 Aug 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.