293 Star 1.6K Fork 379

GVP合宙Luat / LuatOS

 / 详情

[通用] 为string库添加render模板渲染功能

已拒绝
任务 拥有者
创建于  
2023-04-27 23:15

期望的调用效果

local ctx = {name="wendal",age=18}
local str = string.render("/${name}/${age}/abc", ctx)
log.info("str", str) -- 应该输出 /wendal/18/abc

评论 (5)

Wendal 创建了任务
Wendal 负责人设置为Wendal
展开全部操作日志

新建issues,自动分配负责人进行确认

Wendal 任务状态待办的 修改为进行中
Wendal 任务状态进行中 修改为待办的

这个使用场景感觉string.format完全可以实现

format是固定参数顺序了

可不可以不传递ctx,直接读取作用域内的变量名?

嗯,还是format吧

Wendal 任务状态待办的 修改为已拒绝

登录 后才可以发表评论

状态
负责人
项目
里程碑
Pull Requests
关联的 Pull Requests 被合并后可能会关闭此 issue
分支
开始日期   -   截止日期
-
置顶选项
优先级
预计工期 (小时)
参与者(3)
4674 wendal 1578914274 5607411 dozingfiretruck 1596190037 534181 chenxuuu 1578926871
Lua
1
https://gitee.com/openLuat/LuatOS.git
git@gitee.com:openLuat/LuatOS.git
openLuat
LuatOS
LuatOS

搜索帮助