Browse Source

refactor(yvan-lcc):优化 JsDemo 页面的代码执行逻辑

- 在代码模板中添加示例日志输出和日期对象- 优化 execute 函数的异步处理结构
- 调整代码格式,提高可读性
master
lizw-2015 6 months ago
parent
commit
4a1963c57f
  1. 3
      src/pages/JsDemo.vue

3
src/pages/JsDemo.vue

@ -5,11 +5,14 @@ import YvSrcEditor from "../components/YvSrcEditor.vue"
const code = ref(` const code = ref(`
log.info("测试打印日志,通过服务端控制台查看")
const a = 111, b= 555; const a = 111, b= 555;
const sum = (a + b); const sum = (a + b);
print(a + "+" + b + " = " + sum); print(a + "+" + b + " = " + sum);
return { return {
sum,
date: new Date(),
msg: "测试JS脚本", msg: "测试JS脚本",
} }
`); `);

Loading…
Cancel
Save