The module provides a bridge between Drupal and Vue.js framework.
This module does nothing on its own. There is no need to install this module unless another module requires it.
Vue 3 / Petite-Vue Support (3.x)
The 3.x branch is where we'll be supporting Vue 3. We'll also be adding a library definition to include Petite-Vue.
TODO: Add README documentation and link
The library names are
vuejs/vue
vuejs/petitevue
Vue2 Docs (8.x-1.x)
Usage:
1. You can use inside twig templates as usual, example:
{{ attach_library('vuejs/vue') }}
2. You can attach it programmatically:
function MYMODULE_page_attachments(array &$attachments) {
$attachments['#attached']['library'][] = 'vuejs/vue';
}
3. You can add it as dependency inside your *.libraries.yml:
dependencies:
- vuejs/vue
- vuejs/vue_router
- vuejs/vue_resource
4. Loading libraries:
a) Use the following Drush commands if you want to install the libraries locally:
drush vuejs:download vue
drush vuejs:download vue-router
drush vuejs:download vue-resource
Latest (.dev) version also adds the possibility to use composer based requirement:
b) npm-asset:
composer require npm-asset/vue:^2
composer require npm-asset/vue-router
composer require npm-asset/vue-resource
c) bower-asset:
composer require bower-asset/vue:^2
composer require bower-asset/vue-router
composer require bower-asset/vue-resource
(See https://www.drupal.org/docs/develop/using-composer/using-composer-to-ins... for details on using Asset Packagist)
d) The module also proved the option to load the libraries from CDNs.
Project information
- Seeking co-maintainer(s)
Maintainers are looking for help reviewing issues. - Module categories: Developer Tools, Integrations
- 133 sites report using this module
- Created by Chi on , updated
- Stable releases for this project are covered by the security advisory policy.
Look for the shield icon below.
Releases
Development version: 3.x-dev updated 27 Mar 2024 at 14:25 UTC
This is the first release for D7.
Development version: 7.x-1.x-dev updated 4 Nov 2017 at 02:53 UTC