Giter Site home page Giter Site logo

sibiru / vuewidget Goto Github PK

View Code? Open in Web Editor NEW

This project forked from djanoskova/vuidget

0.0 0.0 0.0 3.93 MB

A full-functioning Vue.js (routes, actions, state management..) embeddable widget in HTML

Home Page: https://vuidget.netlify.com

JavaScript 24.76% HTML 44.64% Vue 29.93% CSS 0.67%

vuewidget's Introduction

Vuidget - Vue.js embeddable widget

Supporting Vue-Router and Vuex!

alt text

In case you're wondering how to create a full-functioning Vue.js (routes, actions, state management..) embeddable widget in HTML, check this repository - the source and the commits.

The result are going to be bundled files (only one app.js and app.css file, no chunks), that allow you to embed your widget as an HTML component -

<vue-widget title="TODO list"></vue-widget>

Of course, if you're using custom fonts or images, those are also going to be generated while you build the source.

Source of the working demo is located in example.html in the root folder and also live at http://vuidget.danajanoskova.sk/

Contents of the dist build folder were uploaded to http://vuidget-source.danajanoskova.sk/ and embedded in the demo application. It's necessary to upload your generated files somewhere accessible in order to include them as a widget. Don't forget the .htaccess file to allow various origins to access your widget files, like fonts or images.

Header add Access-Control-Allow-Origin "*"

...

This Vue.js application was created on 22.07.2018 with Vue CLI 3. That means any config I might have is inherited from @vue/cli. Any required dependencies to allow this app to function as an embeddable widget will be listed below.

npm install vue-custom-element --save
  • Webpack - we will be using webpack's "LimitChunkCountPlugin" function to prevent app from creating .js chunks for hidden views
npm install webpack --save
  • (Optional) Custom elements polyfill for cross-browser compatibility, also mentioned in vue-custom-element
npm install document-register-element --save

The command npm run build will build your source files for the widget.

...

Project setup

npm install

Compiles and hot-reloads for development

npm run serve

Compiles and minifies for production

npm run build

vuewidget's People

Contributors

djanoskova avatar dependabot[bot] 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.