Commit 68d9765d authored by ι™ˆεΈ…'s avatar ι™ˆεΈ…

fix: insertcode support

parent 21d4f751
...@@ -126,8 +126,8 @@ const insertRightContent = configPath => { ...@@ -126,8 +126,8 @@ const insertRightContent = configPath => {
body.splice(index, 0, parseCode(`import NoticeIconView from './NoticeIconView';`)); body.splice(index, 0, parseCode(`import NoticeIconView from './NoticeIconView';`));
body.forEach(item => { body.forEach(item => {
if (item.type === 'ClassDeclaration') { if (item.type === 'VariableDeclaration') {
const classBody = item.body.body[0].body; const classBody = item.declarations[0].init.body;
classBody.body.forEach(node => { classBody.body.forEach(node => {
if (node.type === 'ReturnStatement') { if (node.type === 'ReturnStatement') {
const index = node.argument.children.findIndex(item => { const index = node.argument.children.findIndex(item => {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment