An open API service indexing awesome lists of open source software.

https://github.com/vicompany/vue-mixin-data-attributes

Reads `data-` attributes from the element and assigns them to the Vue instance/component.
https://github.com/vicompany/vue-mixin-data-attributes

Last synced: about 2 months ago
JSON representation

Reads `data-` attributes from the element and assigns them to the Vue instance/component.

Awesome Lists containing this project

README

          

# vue-mixin-data-attributes

Reads `data-` attributes from the element and assigns them to the Vue instance/component.

You can use the mixin on components and as global mixin. See [mixin documentation](https://vuejs.org/v2/guide/mixins.html).

```html

```

```js
import dataAttributes from 'vue-mixin-data-attributes';

Vue.component('my-message', {
mixins: [dataAttributes],

data: () => {
return {
message: 'Default message',
},
},

mounted() {
console.log(this.message); // Logs: This is OK
}
});
```

## Installation

`npm install vue-mixin-data-attributes`