update tutorial

This commit is contained in:
dntzhang 2018-12-07 09:32:53 +08:00
parent 9dd72d3c89
commit 9f48b5ad91
2 changed files with 0 additions and 22 deletions

View File

@ -358,17 +358,6 @@ define('todo-list', class extends WeElement {
})
```
需要特别强调的是,当你从数组中移除的时候,需要先清空数组:
```js
remove(id) {
todo.remove(id)
//empty first
this.data.items.length = 0
mapping.auto(todo, this.data)
}
```
[→ 完整代码戳这里](https://github.com/Tencent/omi/tree/master/packages/omi-cli/template/mvvm/src)

View File

@ -350,17 +350,6 @@ define('todo-list', class extends WeElement {
})
```
Needing to pay attention to is that, when you remove item from an array, you need to clear the array first, then using mapping.atuo:
```js
remove(id) {
todo.remove(id)
//empty first
this.data.items.length = 0
mapping.auto(todo, this.data)
}
```
[→ All the source code](https://github.com/Tencent/omi/tree/master/packages/omi/examples/mvvm)
### Summary