Vue: How to add es6 classes logic in methods section?

Created on 24 Jun 2016  路  3Comments  路  Source: vuejs/vue

In vue.js all methods united in methods: {...} section. It uneasily when we have more methods in one component. How to divide methods and implements in es6 classes, as in this example - https://jsfiddle.net/slavik_210/9a5waya2/

Most helpful comment

Besides, please use forum and/or Gitter for such questions.

All 3 comments

1.ES6 Classes are unnecessary here.
2.If your goal is to divide methods, you can simply put them in a separate file

import {foo, bar} from 'some-other-file'
...
methods: {
   foo,
   bar
}

Besides, please use forum and/or Gitter for such questions.

phanan, thank you! I wrote this questions in gitter but bobody answer.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

fergaldoyle picture fergaldoyle  路  3Comments

bfis picture bfis  路  3Comments

franciscolourenco picture franciscolourenco  路  3Comments

hiendv picture hiendv  路  3Comments

WolfgangFellger picture WolfgangFellger  路  3Comments