1
0
mirror of https://github.com/sahadev/vue-component-creater-ui.git synced 2025-09-28 07:13:21 +08:00

验证转发接口

This commit is contained in:
shangbin
2021-09-16 18:24:39 +08:00
parent cc20787843
commit c5d834664c
2 changed files with 11 additions and 7 deletions

View File

@@ -58,8 +58,10 @@ export class MainPanelProvider {
const { template, script, styles, customBlocks } = parseComponent(code);
let newScript = script.content.replace("export default", "")
newScript = newScript.replace(/\s+/g, "");
let newScript = script.content.replace(/\s*export default\s*/, "")
// 将xxx: () => {} 转换为xxx(){}
newScript = newScript.replace(/:\s*\(([\w\s]*)\)\s*=>/g,"\($1\)");
const componentOptions = (new Function(`return ${newScript}`))();