Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rpkilby/vue-super
Vue.js plugin that allows you to reference methods on parent classes
https://github.com/rpkilby/vue-super
Last synced: about 1 month ago
JSON representation
Vue.js plugin that allows you to reference methods on parent classes
- Host: GitHub
- URL: https://github.com/rpkilby/vue-super
- Owner: rpkilby
- License: mit
- Created: 2016-03-02T01:27:31.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2019-12-20T01:52:10.000Z (over 4 years ago)
- Last Synced: 2024-01-28T14:33:16.395Z (4 months ago)
- Language: JavaScript
- Homepage:
- Size: 7.81 KB
- Stars: 35
- Watchers: 3
- Forks: 5
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Lists
- awesome-vue - vue-super - A simple plugin to call methods on parent components. (Components & Libraries / Utilities)
- awesome-vue - vue-super - A simple plugin to call methods on parent components. (Components & Libraries / Utilities)
- awesome-vue - vue-super - A simple plugin to call methods on parent components. (Components & Libraries / Utilities)
- awesome-vue - vue-super - A simple plugin to call methods on parent components. (Components & Libraries / Utilities)
- awesome-vue - vue-super - A simple plugin to call methods on parent components. (Components & Libraries / Utilities)
- awesome-vuejs - vue-super ★7
- awesomer-vue - vue-super - A simple plugin to call methods on parent components. (Utilities / Miscellaneous)
- awesome-vue - vue-super - A simple plugin to call methods on parent components. (Components & Libraries / Utilities)
- awesome-vue - vue-super - A simple plugin to call methods on parent components. (Components & Libraries / Utilities)
- awesome-vue - vue-super - A simple plugin to call methods on parent components. (Components & Libraries / Utilities)
- awesome-vue. - vue-super - A simple plugin to call methods on parent components. (Utilities / Miscellaneous)
- awesome-vue - vue-super - A simple plugin to call methods on parent components. (Components & Libraries / Utilities)
- awesome-vue - vue-super - A simple plugin to call methods on parent components. (Utilities / Miscellaneous)
- awesome-vue - vue-super - A simple plugin to call methods on parent components. (Utilities / Miscellaneous)
- awesome-vue - vue-super - A simple plugin to call methods on parent components. (Utilities / Miscellaneous)
- awesome-vue - vue-super - A simple plugin to call methods on parent components. (Utilities / Miscellaneous)
- awesome-vue - vue-super - A simple plugin to call methods on parent components. (Utilities / Miscellaneous)
- awesome-vue - vue-super ★25 - A simple plugin to call methods on parent components. (Utilities / Miscellaneous)
- awesome-vue - vue-super - A simple plugin to call methods on parent components. (Components & Libraries / Utilities)
- awesome-vuejs - vue-super - A simple plugin to call methods on parent components. (Utilities / Miscellaneous)
- awesome-vue-refactor - vue-super ★7
- repo-560-awesome-vue-cn - vue-super ★5
- awesome-vue-cn - vue-super ★5
README
# vue-super
[![Build Status](https://travis-ci.org/rpkilby/vue-super.svg?branch=master)](https://travis-ci.org/rpkilby/vue-super)
[![codecov](https://codecov.io/gh/rpkilby/vue-super/branch/master/graph/badge.svg)](https://codecov.io/gh/rpkilby/vue-super)
[![Version](https://img.shields.io/npm/v/vue-super.svg)](https://www.npmjs.com/package/vue-super)Provides a `$super` handler for accessing parent vue methods from a subclass.
Behaves similarly to python's super implementation.> vue-super is tested against both vue@1 and vue@2
Example:
```js
const Parent = Vue.extend({
methods: {
doTheThing: function(){
console.log('performing a parental action');
},
},
})const Child = Parent.extend({
methods: {
doTheThing: function() {
this.$super(Child, this).doTheThing();
console.log('doing a childlike thing');
},
},
})
```For convenience, methods are directly accessible on the `$super` object.
However, this behavior is only valid on a final subclass.```js
const Final = Child.extend({
methods: {
doTheThing: function() {
this.$super.doTheThing();
console.log('doing the final thing');
},
},
})
```