vue-alias

0.1.0 • Public • Published

VUE alias helper

This package will help use alias in render function In future it wiil help you change components or frameworks

NOTE: Module is in initial development. Anything may change at any time.

example

import { register } from 'vue-alias'
 
// register aliases
register({
  text: {
    component: 'VTextField',
    replaces: {
      error: 'errorMessages'
    }
  },
  textarea: {
    component: 'v-textarea',
    replaces: {
      error: 'errorMessages'
    }
  },
  select: {
    component: 'v-select',
    replaces: {
      error: 'errorMessages'
    }
  },
  ...
})

Then you can use in vue component render function

import { wrapHandler } from 'vue-alias'
 
...
render (h) {
  h = wrapHandler(h)
  return h('select', {props: {}}, children)
}

or

import { alias } from 'vue-alias'
 
...
const cmp = alias(component)
}

Readme

Keywords

Package Sidebar

Install

npm i vue-alias

Weekly Downloads

6

Version

0.1.0

License

MIT

Unpacked Size

12.3 kB

Total Files

7

Last publish

Collaborators

  • yariksav