From a474e800dd49142021a4b978ba53966b3c0b31c6 Mon Sep 17 00:00:00 2001 From: snovey Date: Fri, 26 Jul 2019 02:14:49 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B7=91=E8=B5=B7=E6=9D=A5=E6=9C=89=E7=82=B9?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. 加了大括号 2. 加了一点容错 --- ...344\276\235\350\265\226\346\224\266\351\233\206.MarkDown" | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git "a/docs/\344\276\235\350\265\226\346\224\266\351\233\206.MarkDown" "b/docs/\344\276\235\350\265\226\346\224\266\351\233\206.MarkDown" index 66b3fae..d95d05c 100644 --- "a/docs/\344\276\235\350\265\226\346\224\266\351\233\206.MarkDown" +++ "b/docs/\344\276\235\350\265\226\346\224\266\351\233\206.MarkDown" @@ -52,6 +52,7 @@ function remove (arr, item) { const index = arr.indexOf(item) if (index > -1) { return arr.splice(index, 1) + } } } ``` @@ -70,11 +71,11 @@ class Watcher { Dep.target = this; /*Github:https://github.com/answershuto*/ /*触发渲染操作进行依赖收集*/ - this.cb.call(this.vm); + this.cb && this.cb.call(this.vm); } update () { - this.cb.call(this.vm); + this.cb && this.cb.call(this.vm); } } ```