From 68d9765dab7b09b9ff933b7240fcfb95331a408b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=B8=85?= Date: Tue, 18 Jun 2019 19:56:32 +0800 Subject: [PATCH] fix: insertcode support --- scripts/insertCode.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/insertCode.js b/scripts/insertCode.js index d631dfa1..298df951 100644 --- a/scripts/insertCode.js +++ b/scripts/insertCode.js @@ -126,8 +126,8 @@ const insertRightContent = configPath => { body.splice(index, 0, parseCode(`import NoticeIconView from './NoticeIconView';`)); body.forEach(item => { - if (item.type === 'ClassDeclaration') { - const classBody = item.body.body[0].body; + if (item.type === 'VariableDeclaration') { + const classBody = item.declarations[0].init.body; classBody.body.forEach(node => { if (node.type === 'ReturnStatement') { const index = node.argument.children.findIndex(item => { -- GitLab