This post has been republished via RSS; it originally appeared at: New blog articles in Microsoft Tech Community.
Uno Platform is one of the development platform tools for cross-platform apps such as UWP, Android, iOS, and WebAssembly.
Let's call a simple JS function
However, almost all real libraries provide them functions as a module. For example, if you would like to show toast notifications on the web browser, suppose you use iziToast.
You will download it, and copy .js files and .css files as Embedded resource to the WASM project, like below:
However, it doesn't work with the following error:
Because a WASM app of Uno Platform includes require.js, so iziToast detects it when loading, and all functions is provided as a module that name is 'iziToast,' so you have to require it before using it.
The correct code to use iziToast from Uno Platform is as below:
It works fine.
And if you feel Uno Platform is interesting, then please check the official site: