Sample ToDo application that demonstrates the usage of UI5 Web Components using Svelte
The application showcases how to: bind properties, subscribe to and forward events, and consume UI5 Web Components within Svelte.
Project was initialized uising ViteJs and the svelte-ts tempalte
- Node.js version >=12.0.0.
- Clone this repository and navigate to the downloaded directory
git clone https://github.tools.sap/I546507/ui5-webcomponents-sample-svelte.git cd ui5-webcomponents-sample-svelte
- Install all dependencies
yarn
- Start the local dev server and run the application
yarn dev
Create an issue in this repository if you find a bug or have questions about the content.
For additional support, ask a question in SAP Community.
-
Import the desired component(s) in your app to define the UI5 Web Component.
-
For example, to use
ui5-button
you need to import it:import "@ui5/webcomponents/dist/Button"; // loads ui5-button
Then, you can use the custom element in an HTML page:
<ui5-button>Hello world!</ui5-button>
-
Currently only Chrome, Safari and Firefox support Web Components natively.
-
If your application should run on browsers without native Web Components support (Edge and/or IE11), import one the following modules before your first Web Component import:
-
import "@ui5/webcomponents-base/dist/features/browsersupport/Edge";
-
import "@ui5/webcomponents-base/dist/features/browsersupport/IE11";
Note: Importing the module for IE11 support automatically enables Edge support as well, so there is no need to import them both explicitly.
Example:
import "@ui5/webcomponents-base/dist/features/browsersupport/IE11"; // This will enable Edge and IE11 support for all Web Components below import "@ui5/webcomponents/dist/Button"; // loads ui5-button import "@ui5/webcomponents/dist/Label"; // loads ui5-label
If you wish to contribute code, offer fixes or improvements, please send a pull request. Due to legal reasons, contributors will be asked to accept a DCO when they create the first pull request to this project. This happens in an automated fashion during the submission process. SAP uses the standard DCO text of the Linux Foundation.
Copyright (c) 2021 SAP SE or an SAP affiliate company. All rights reserved. This project is licensed under the Apache Software License, version 2.0 except as noted otherwise in the LICENSE file.