Fast application definition in app.ux The global variables in the JS file can be obtained through the quick application of the public method getapp (). For details, please refer to the following example code.
app.ux code:
data: {
AppData: '123456',
}
JS file:
export default {
getAppData() {
return getApp().$def.data.AppData
}
}
For more details, please refer to:
Quick application development guidance document: https://developer.huawei.com/consumer/cn/doc/development/quickApp-Guides/quickapp-whitepaper
Quick application script:
https://developer.huawei.com/consumer/cn/doc/development/quickApp-References/quickapp-script
Link to the original text: https://developer.huawei.com/consumer/cn/forum/topic/0204411133432620361?fid=18
Original author: mayism
Read More:
- Python global variables and global keywords
- ERROR in static/js/app.xxxxxxx.js from UglifyJs Unexpected token: operator (>)
- Differences between using VaR and omitting VaR to define variables in JS
- Register global time filter in main.js in Vue
- Failed to connect to non-global ctrl_ifname: (nil) error: No such file or directory (How to Fix)
- SCRIPT1002: syntax error File: 0. chunk.js ,SCRIPT5009: ‘Map‘ is undefined File: 0. chunk.js -Solutions
- Java – read all the files and folders in a certain directory and three methods to get the file name from the file path
- After vscode installs ts, TSC compiles and generates JS, and an error is reported (repeated variables, etc.)
- How to distinguish the source channel of router.push jump fast application
- JS prompt cannot read property ‘style’ of undefined
- Use less.js to verify and report an error in the Vue file of vscode
- Error: global variable is ambiguous (conflict between using namespace STD and global variable)
- Error reading file cow.osg: read error (Could not find plugin to read objects from file “cow.osg“.)
- Springboot error, unable to read configuration file: could not resolve placeholder ‘xxx’ in value “${XXX}
- ./src/App.js Line 13:11: Parsing error: Unterminated JSX contents (react)
- SyntaxError: (unicode error) ‘unicodeescape‘ codec can‘t decode bytes in position 2-3: truncated \UX
- SyntaxError: (unicode error) ‘unicodeescape‘ codec can‘t decode bytes in position 2-3: truncated \UX
- Read in wannier90 output file hr.dat to construct real space Hamiltonian to calculate Fermi surface
- [error] OpenEvent(“Global\ngx_reload_11812“) failed (2: The system cannot find the file specified
- Quickly solve the problem of Vmware virtual machine “\\.\Global\vmx86”: the system cannot find the specified file