edgardleal/require-vuejs

View on GitHub
examples/js_in_different_file.js

Summary

Maintainability
A
0 mins
Test Coverage

define([], function() {
    return {
        data: () => ({
            message: '',
            clickcount: 0,
        }),
        methods: {
            inc() {
                this.clickcount += 1;
            },
            click() {
                this.inc();
                this.message = this.clickcount + ' Clicks';
            },
        },
    };
});