The global variables defined by the quick app in app.ux can be obtained by using the common method getApp() in the JavaScript file. For details, refer to the sample code:
app.ux file:
JavaScript file:
For more details, please refer to:
Quick app materials: https://developer.huawei.com/consumer/en/doc/development/quickApp-Guides/quickapp-introduction
Quick app script:
https://developer.huawei.com/consumer/en/doc/development/quickApp-References/quickapp-script
app.ux file:
JavaScript:
data: {
AppData: '123456',
}
JavaScript file:
JavaScript:
export default {
getAppData() {
return getApp().$def.data.AppData
}
}
For more details, please refer to:
Quick app materials: https://developer.huawei.com/consumer/en/doc/development/quickApp-Guides/quickapp-introduction
Quick app script:
https://developer.huawei.com/consumer/en/doc/development/quickApp-References/quickapp-script