0.1.9 • Published 5 years ago

vue-methodly v0.1.9

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

Vue Methodly

A simple Vue plugin to augment your Vue instance methods with custom ones

Install

NPM/Yarn

npm install vue-methodly --save

or

yarn add vue-methodly --save

Browser

<script src="https://unpkg.com/vue-methodly"></script>

Usage

Webpack

import VueMethodly from 'vue-methodly'
...
Vue.use(VueMethodly, {
  methods: [
    {
      // the name of your custom method
      name: 'myCustomMethod',

      // the native hook on which to execute
      hook: 'mounted'
    },
    ...
  ]
})
...
// some component
...
export default {
  ...
  // gets executed before the native mounted() hook
  myCustomMethod () {
    // whatever you like here
  },
  ...
}
...

Browser

Vue.use(VueMethodly, {
  methods: [
    {
      // the name of your custom method
      name: 'myCustomMethod',

      // the hook before which to execute
      hook: 'mounted'
    },
    ...
  ]
})
Vue.component('MyComponent', {
  ...
  // gets executed before the native mounted() hook
  myCustomMethod () {
    // whatever you like here
  },
  ...
})

Example

https://jsfiddle.net/yprbeh5f/

0.1.9

5 years ago

0.1.8

6 years ago

0.1.7

6 years ago

0.1.6

6 years ago

0.1.5

6 years ago

0.1.4

6 years ago

0.1.3

6 years ago

0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago

0.0.9

6 years ago

0.0.8

6 years ago

0.0.7

6 years ago

0.0.6

6 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago