An open API service indexing awesome lists of open source software.

https://github.com/refi64/vue-module

Define Vue components using a web components-like syntax
https://github.com/refi64/vue-module

Last synced: 4 months ago
JSON representation

Define Vue components using a web components-like syntax

Awesome Lists containing this project

README

          

vue-module
==========

Define Vue components using a web components-like syntax. See the ``example``
for more info.

You'll likely need to first load ``webcomponents-lite.js``, which can be
found `here `_.

Quick demo
**********

In *index.html*:

.. code-block:: html






Vue.use(VueModule);






document.addEventListener('WebComponentsReady', function() {
new Vue({el: '#example-app'})
});

In *example-component.html*:

.. code-block:: html





{{message}}



Vue.module('example-component', {
data: function() {
return { message: 'Hello!' };
},

// If you need to use v-once, then add:
once: true,
});

Styling
*******

When you use *vue-module*, your elements are automatically wrapped in a div with a class the
same name as your component. For example:

.. code-block:: html




.my-component p { color: purple; }


My module!



Vue.module('my-component');