New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More

vue-mixin-data-attributes

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-mixin-data-attributes

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

  • 1.0.3
  • latest
  • npm
  • Socket score
67

Supply Chain Security

72

Quality

82

Maintenance

100

Vulnerabilities

100

License


Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created

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.

<my-message data-message="This is OK"></my-message>
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

FAQs

Package last updated on 16 Feb 2017

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