在 SAP 中从控制器的其他方法调用事件函数
建议不要从任何其他函数调用事件函数,但你可以做的就是将事件函数实现重构到一个单独的函数中,并从任何其他函数调用它,如下所示
示例
BtnPress: function(oEvent) {
// Separate the implementation in the helper function
this.btnPressHelper();
}
// Define the helper
btnPressHelper: function() {
//logic here
}
// call the helper from whichever function you want to get the desired output
PerformSomething: function() {
this.btnTapHelper();
}
广告
数据结构
网络
RDBMS
操作系统
Java
iOS
HTML
CSS
Android
Python
C 编程
C++
C#
MongoDB
MySQL
Javascript
PHP