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

lmnsg picture lmnsg  Â·  3Comments

loki0609 picture loki0609  Â·  3Comments

Jokcy picture Jokcy  Â·  3Comments

aviggngyv picture aviggngyv  Â·  3Comments

WolfgangFellger picture WolfgangFellger  Â·  3Comments