Commit ae4b5f58 authored by les's avatar les

first experiments with vue webcomponets

parent 81bbf8c2
......@@ -12,7 +12,8 @@
"doc": "cd docs && bundle exec jekyll b",
"doc:dev": "cd docs && bundle exec jekyll s --drafts",
"migrate:dev": "sequelize db:migrate",
"migrate": "NODE_ENV=production sequelize db:migrate"
"migrate": "NODE_ENV=production sequelize db:migrate",
"wc": "vue build --target wc --name gancio-event ./webcomponents/gancio-event/src/main.js"
"license": "AGPL-3.0",
"bugs": {
......@@ -55,6 +56,7 @@
"dependencies": {
"@nuxtjs/auth": "^4.8.5",
"@nuxtjs/axios": "^5.9.5",
"@vue/web-component-wrapper": "^1.2.0",
"accept-language": "^3.0.18",
"axios": "^0.19.2",
"bcryptjs": "^2.4.3",
<template lang='pug'>
h3 ciao {{event.title}}
span {{}}
export default {
name: 'GancioEvent',
props: {
eventUrl: String
data () {
return {
event: { place: {} }
mounted () {
// qui dovrei fetchare event id
.then(ret => ret.json())
.then(event => {
.catch(e => console.error(e))
<!-- Add "scoped" attribute to limit CSS to this component only -->
.gancio-event {
display: inline-block;
width: 300px;
border: 1px solid grey;
background-color: black;
color: white;
<!DOCTYPE html>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<title>My Non-Vue App</title>
<!--Load Vue-->
<script src=""></script>
<!--Load the web component polyfill-->
<script src=""></script>
<!--Load your custom element-->
<script src="./dist/gancio-event.min.js"></script>
<!--Use your custom element-->
<gancio-event event-url='http://localhost:13120/api/event/6'></gancio-event>
import Vue from 'vue'
import wrap from '@vue/web-component-wrapper'
import GancioEvent from './GancioEvent'
const CustomElement = wrap(Vue, GancioEvent)
window.customElements.define('gancio-event', CustomElement)
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment