提交 d515fd8a 编写于 作者: 雪洛's avatar 雪洛

docs: update schema ext

上级 c7f7a540
......@@ -85,6 +85,7 @@ ext.js里引入公共模块的机制:
|userInfo |object |- |是 |用户信息 |
|result |object |- |afterXxx内必备 |本次请求结果 |
|isEqualToJql |function |- |是 |用于判断当前执行的jql语句和执行语句是否相等 |
|triggerContext |object |- |是 |用于在before和after内共享数据 |
#### where@where
......@@ -221,6 +222,32 @@ module.exports {
}
```
#### triggerContext@trigger-context
> 新增于 HBuilderX 3.6.16
此参数为一个空对象,仅用于在before内挂载数据并在after内获取使用
**示例**
```js
// article.schema.ext.js
module.exports {
trigger: {
beforeUpdate: async function({
triggerContext
} = {}) {
triggerContext.shareVar = 1
},
afterUpdate: async function(){
if (triggerContext.shareVar === 1) {
console.log('获取到的triggerContext.shareVar为1')
}
}
}
}
```
### 触发时机@trigger-timing
|触发时机 |说明 |
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册