华为云Astro大屏应用-组件响应动作实现:响应动作函数
时间:2025-02-12 15:04:21
响应动作函数
以数据刷新的响应动作函数为例,向您介绍组件的响应动作函数。
/*** 数据刷新的响应动作函数示例 * 文件global_SelectWidget.js中, 与render函数平级定义*/confirmLocationWidgetCbk: function (param) { if (param && param.eventParam && this.vm) { this.vm.getDataEntry(param.eventParam); } },// 获取当前输入框值getInputValue: function () {if (this.vm && this.vm.selectConfObj) { return this.vm.selectConfObj.selectValue; }},// 设置组件双向绑定的值setInputWidgetValue: function (value) { this.vm.selectConfObj.selectValue = value; if (this.editVm?.selectConfObj) { this.editVm.selectConfObj.selectValue = value; }this.advanceEditvm?.save();},// 更新组件配置setWidgetProperties: function (selectConfObj) {magno.savePropertiesForWidget({ selectConfObj: JSON.stringify(selectConfObj), });},setInput: function (value) { this.vm.selectConfObj.selectValue = value.customizeVal; if (this.editVm?.selectConfObj) { this.editVm.selectConfObj.selectValue = value.customizeVal; } this.advanceEditvm?.save();},
support.huaweicloud.com/usermanual-astrocanvas/astrocanvas_05_7160.html