deadsimple / vuelibrary
A deadsimple module to use VueJS components in your Magento2 webshops
Installs: 4 702
Dependents: 2
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Language:JavaScript
Type:magento2-module
Requires
- magento/framework: >=100.1.0
This package is auto-updated.
Last update: 2025-01-12 22:44:08 UTC
README
Deadsimple VueJS Magento2 Composer Library
This package allows you to use VueJs together with requirejs in your Magento2 setup straight out of the box
Installation
Use composer to install the module: composer require deadsimple/vuelibrary
Development mode
This module loads VueJS in minified production mode by default but is served with a developer version too, if you need VueJS in development mode change your requirejs-config.js
to:
var config = {
paths: {
Vue: 'Deadsimple_VueLibrary/js/lib/vue',
vue: 'Deadsimple_VueLibrary/js/lib/require-vuejs',
},
shim: {
Vue: {
exports: 'Vue'
}
}
};
Usage
Create a main js file to load through requirejs in this main.js file define Vue
(with a capital V) and use vue
(see the non capital v) to load your created vue components in this example Searchinput.vue
. From this point on you can initialize vue the way your used to with the new Vue()
initializer, please make sure you have a container available to run your VueJS code in #essearch
in this example;
define([
'Vue',
'vue!components/SearchInput.vue'
], function (Vue) {
'use strict';
new Vue({
el: '#essearch',
});
})
Version
This library loads: Vue.js v2.6.14
TODO
- Create easier switch between production and development version of VueJS
- Add to library bundling if available