From 7cf037b9b6e4b859d6adcac6b92f8275b7d0b032 Mon Sep 17 00:00:00 2001 From: momoca Date: Wed, 11 Sep 2019 15:28:10 +0800 Subject: [PATCH] Update template7.js hasOwnProperty the inherited properties are not displayed. --- dist/template7.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dist/template7.js b/dist/template7.js index 2bac81a..ea29b23 100644 --- a/dist/template7.js +++ b/dist/template7.js @@ -414,8 +414,10 @@ } else { // eslint-disable-next-line for (var key in ctx) { - i += 1; - ret += options.fn(ctx[key], { key: key }); + if (ctx.hasOwnProperty(key)) { + i += 1; + ret += options.fn(ctx[key], { key: key }); + } } } if (i > 0) { return ret; }