Giter VIP home page Giter VIP logo

ui5-webcomponents-sample-vue's Introduction

UI5 logo CI REUSE status

UI5 Web Components Vue Sample Application

Vue sample application to demonstrate the usage of the UI5 Web Components. It shows how to bind properties, to subscribe to events, using nested components and the bootstrapped Vue build.

This project was bootstrapped with Vue CLI

Prerequisites

  • Node.js (version 8.5 or higher โš ๏ธ)

Getting started

  1. Clone this repository using the GitHub Command line tool and navigate into the downloaded directory.

    git clone https://github.com/SAP-samples/ui5-webcomponents-sample-vue.git
    cd ui5-webcomponents-sample-vue
  2. Install all dependencies

    npm install
  3. Start a local server and run the application. (The running application can be found here: http://localhost:5173)

    npm run dev

Noteworthy

Consume UI5 Web Components

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>

Browser support

Currently Chrome, Safari, Firefox and Edge (Chromium-based) support Web Components natively.

Configure Vue to work with Web Components defined outside of it

It is recommended to exclude our custom elements from component resolution by specifying compilerOptions.isCustomElement in our vite.config file.

// vite.config.js

import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [
    vue({
      template: {
        compilerOptions: {
          // treat all tags with a "ui5-" prefix as custom elements
          isCustomElement: tag => tag.startsWith('ui5-')
        }
      }
    })
  ]
})

Where is the npm package?

Limitations

No limitations known.

Known Issues

No major bugs known.

Support

We welcome all comments, suggestions, questions, and bug reports. Please follow our Support Guidelines on how to report an issue, or chat with us in the #webcomponents channel of the OpenUI5 Community Slack.

Contribute to UI5 Web Components

Please check our Contribution Guidelines.

ui5-webcomponents-sample-vue's People

Contributors

adrian-bobev avatar alessandra-souza avatar anselm94 avatar btbernard avatar codesofra avatar dependabot[bot] avatar fifoosid avatar hinzzx avatar ilhan007 avatar mapto0 avatar mmoudy49 avatar petermuessig avatar vladitasev avatar zhihuidev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ui5-webcomponents-sample-vue's Issues

This dependency was not found error

Hi,

I followed the getting started section, did the command:

> npm install

and

> npm run serve

then I get this console error

jhodel: ui5-webcomponents-sample-vue git@master > npm run serve

> [email protected] serve /Users/jhodel/Downloads/ui5-webcomponents-sample-vue
> vue-cli-service serve

 INFO  Starting development server...
40% building 208/242 modules 34 active /Users/jhodel/Downloads/ui5-webcomponents-sample-vue/node_modules/@ui5/webcomponents/node_modules/@ui5/webcomponents-base/dist/types/CalendarType.jsBrowserslist: caniuse-lite is outdated. Please run next command `npm update`
98% after emitting CopyPlugin

 ERROR  Failed to compile with 1 errors                                                                                                                                              16:32:51

This dependency was not found:

* @ui5/webcomponents-base/dist/features/browsersupport/Edge in ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/App.vue?vue&type=script&lang=js&

To install it, you can run: npm install --save @ui5/webcomponents-base/dist/features/browsersupport/Edge

I tried following the suggestion and execute the install command but eventually get another error:

jhodel: ui5-webcomponents-sample-vue git@master > npm install --save @ui5/webcomponents-base/dist/features/browsersupport/Edge
npm ERR! code ENOLOCAL
npm ERR! Could not install from "@ui5/webcomponents-base/dist/features/browsersupport/Edge" as it does not contain a package.json file.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/jhodel/.npm/_logs/2021-03-27T08_39_46_725Z-debug.log

Can please help to identify what's wrong?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.