A CLI to convert WaveMaker Prefabs to WebComponents
The CLI requires & prompts the user for WaveMaker Prefab project path(Exported from WaveMaker).
The CLI can take them as paramaters,
-s | --prefab-project-path
The CLI can be invoked directly without installation using npx
&
will ensure it executes the latest version available.
npx @wavemaker/webcomponents-cli -s /path/to/prefab/project
All properties, methods, and events are attached to the web component's DOM element. To interact with the component, you must first select the element in the DOM.
const webcomponent = .querySelector('webcomp-tagname');
You can retrieve or modify properties using:
webcomponent.propname;
Invoke methods using:
webcomponent.methodname();
To handle events, use the standard addEventListener method:
webcomponent.addEventListener('eventname', callBackMethod);
The web component may not be ready immediately. To ensure you access properties, methods and events only after initialization, listen for the 'init' event:
webcomponent.addEventListener('init', () => {
console.log('Web component initialized');
});
This ensures that your interactions with the web component happen at the right time.