Giter VIP home page Giter VIP logo

webcomponent-intro's Introduction

Webcomponent-intro

Prerequisites

Install

# install the polymer cli: (in some environments this requires `--unsafe-perm` to be added)
npm install -g polymer-cli

# get this repository from git:
git clone https://github.com/Geodan/webcomponent-intro
cd webcomponents-intro

# install dependencies (lit-element, lit-html):
npm install

#start Visual Studio Code (mind the dot behind 'code'!):
code .

# inside Visual Studio Code, select menu "Terminal"=>"New Terminal"
# in the new terminal, type:
npm start

Usage

Point your browser to localhost:8081 (or any other port if so specified by the output of 'npm start').

The home page (Plain HTML) and shell (App HTML) pages show two components:

  1. simple-element
    • simple-element is a very basic component derived from LitElement
  2. full-element
    • basic element that implements most LitElement methods. Every method logs to the web-console.

The native component example shows component:

  1. medium-element
    • basic native component, no framework code used

build polymer components for production

To use the LitElement components with a standard static webserver, you have to build them:

$ npm run-script build
# the component build output is in directory /build/es5-bundled

you can now import these components into standard webserver html:

<script type="module">
    import './build/es5-bundled/simple-element.js';
 </script>
 <simple-element></simple-element>

Some very basic webcomponents

  • simple-element (lit-element)
  • medium-element (native element)
  • full-element (lit-element)

webcomponent-intro's People

Contributors

anneb avatar tomvantilburg avatar bertt avatar

Watchers

Rubio Vaughan avatar  avatar  avatar James Cloos avatar Olaf avatar  avatar  avatar  avatar Tim Ebben avatar  avatar Huub Fleuren avatar Bart Knuiman avatar  avatar  avatar

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.