Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kaizendorks/vue-autowire
Vue plugin with conventions for automatically wiring components, pages and routes
https://github.com/kaizendorks/vue-autowire
Last synced: about 15 hours ago
JSON representation
Vue plugin with conventions for automatically wiring components, pages and routes
- Host: GitHub
- URL: https://github.com/kaizendorks/vue-autowire
- Owner: kaizendorks
- License: mit
- Created: 2019-03-03T15:37:38.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-12-09T02:52:25.000Z (almost 2 years ago)
- Last Synced: 2024-11-12T22:49:28.646Z (6 days ago)
- Language: JavaScript
- Homepage: https://kaizendorks.github.io/vue-autowire/
- Size: 3.42 MB
- Stars: 7
- Watchers: 4
- Forks: 1
- Open Issues: 16
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# vue-autowire
> In development![![Build Status](https://travis-ci.com/kaizendorks/vue-autowire.svg?branch=master)](https://travis-ci.com/kaizendorks/vue-autowire)
Vue Autowire is a Vue plugin with conventions for automatically wiring different Vue assets:
- components
- views
- directives
- filters
- mixins
- routesQuick usage on a Vue-CLI project
``` js
import Vue from 'vue'
import App from './App.vue'
import VueAutowire from 'vue-autowire'// Use the default conventions
import defaultConventions from 'vue-autowire/src/conventions';
Vue.use(VueAutowire, defaultConventions)Vue.config.productionTip = false
new Vue({
render: h => h(App),
}).$mount('#app')
```Auto wire only certain assets, but with their default conventions
``` js
import componentsConventions from 'vue-autowire/src/conventions/components';
Vue.use(VueAutowire, componentsConventions)
```Mix and match defaults and your custom conventions
``` js
import componentsConventions from 'vue-autowire/src/conventions/components';
Vue.use(VueAutowire, Object.assign(componentsConventions, {
views: {
// Provide your own views convention. For example:
// register all .vue files (excluding .local.vue and .async.vue) inside the /views folder as regular components
requireContext: require.context('./views', true, /\/(?:[^.]+|(?!\.local\.vue$)|(?!\.async\.vue$))\.vue$/),
// register all .async.vue files inside the /views folder as dynamic components
requireAsyncContext: require.context('./views', true, /\.async\.vue$/, 'lazy'),
}
}))
```Read through the docs at https://kaizendorks.github.io/vue-autowire/ for more information about the default conventions and how to create your own.