Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

asva-vue-modules

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

asva-vue-modules

Easily add routes, components and partials to vue.

  • 0.2.6
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

Travis CI

Vue Modules

This library is vue.js plugin. It is intended to simplify adding components, partials and routes. It provides easy module structure and supports nested modules.

Installing

First, add dependency to your project.

npm install asva-vue-modules --save

Then install plugin.

Vue.use(require('asva-vue-modules'))

Usage

When your app becomes large enough, you'd need some modularity to pay your technical debt. By modules I mean bundles of components, partials, routes and child modules.

Here's your typical module file:

// module.js

module.exports = {
    components: {
        vmBoards: require('./boards.vue'),
        vmBoardCreateModal: require('./board-create-modal.vue'),
        vmBoardEditModal: require('./board-edit-modal.vue'),
        vmBoardStats: require('./board-stats.vue'),
        vmBoardsFilterBlock: require('./boards-filter-block.vue'),
    },
    partials: {
        boardForm: require('./board-form.html'),
    },
    routes: {
        '/boards': {
            component: {
                template: `<vm-boards></vm-boards>`
            }
        },
    },
    modules: [
        require('./modules/BoardEditor'),
        require('./modules/ProxyManager'),
    ]
}

And here is what you can do with it.

  • Install all components and partials in module.
var module = require('module')
Vue.registerModule(module)
  • Get collection of routes
var routes = Vue.getRoutes(module)

Which you can easily use in vue-router.

Vue.use(VueRouter)
var router = new VueRouter({history: true});
router.map(routes)

Nesting

If you have nested modules, these will be imported as well, same applies to routes.

Credits

  • Yauheni Prakopchyk - Asva

License

This project is licensed under the MIT License

Keywords

FAQs

Package last updated on 03 Jun 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc