From 19ccdff478b8fdc895700fbaa51d851ba35be814 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=87=E5=A4=A9?= Date: Wed, 3 Oct 2018 23:15:16 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=BB=84=E4=BB=B6=E4=BA=8B?= =?UTF-8?q?=E4=BB=B6=E7=BB=91=E5=AE=9A=E4=B8=8D=E6=94=AF=E6=8C=81=E7=BB=91?= =?UTF-8?q?=E5=AE=9A=E5=AD=90=E5=B1=9E=E6=80=A7=E4=B8=8A=E7=9A=84=E6=96=B9?= =?UTF-8?q?=E6=B3=95=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- src/13-scan.js | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 0fbc7b9..b4f05c1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "anot", - "version": "1.0.3", + "version": "1.0.4", "description": "Anot - 迷你mvvm框架", "main": "dist/anot.js", "files": [ diff --git a/src/13-scan.js b/src/13-scan.js index 9e3bea0..762d761 100644 --- a/src/13-scan.js +++ b/src/13-scan.js @@ -120,11 +120,9 @@ function getOptionsFromTag(elem, vmodels) { if (vm.$id.slice(0, 10) === 'proxy-each') { vm = vm.$up } - if ( - vm.hasOwnProperty(attr.value) && - typeof vm[attr.value] === 'function' - ) { - ret[camelizeName] = vm[attr.value].bind(vm) + var fn = parseVmValue(vm, attr.value) + if (fn && typeof fn === 'function') { + ret[camelizeName] = fn.bind(vm) } } else { ret[camelizeName] = parseData(attr.value)