Skip to content

Commit

Permalink
feat(miniprogram): rule 参数支持函数计算
Browse files Browse the repository at this point in the history
  • Loading branch information
dlhandsome committed Dec 12, 2023
1 parent 94f0573 commit 963a4fc
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions packages/runtime/miniprogram/src/rule/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,24 @@ Component({
},
observers: {
'config.id'(v) {
this.setData({ prefix: prefix + v });
const id = isFunc(v) ? v() : v;
this.setData({ prefix: prefix + id });
},
'config.title'(v) {
this.setData({ title: v });
const title = isFunc(v) ? v() : v;
this.setData({ title });
},
'config.meta'(v) {
this.setData({ meta: v });
const meta = isFunc(v) ? v() : v;
this.setData({ meta });
},
'config.desc'(v) {
this.setData({ desc: v });
const desc = isFunc(v) ? v() : v;
this.setData({ desc });
},
'config.type'(v) {
this.setData({ type: v });
const type = isFunc(v) ? v() : v;
this.setData({ type });
},
'config.state'(state) {
let nameState = '';
Expand Down

0 comments on commit 963a4fc

Please sign in to comment.