Chrome Extension

Define a new component in Vue.js

Vue.component('component_name', {
    props: ['prop_name'],
    template: '<div class="root"></div>',
    data: function() {
        return {}
    },
    methods: {
    },
    created: function() {
    }
});

The code can be used to define a new component in Vue.js. You can use this component by creating tag named as component name as below.

<component_name></component_name>

Search history ×