Open matteocontrini opened 9 years ago
Should every VM have its own file
IMHO, yes.
On Mon, Sep 21, 2015 at 7:49 AM, Matteo Contrini notifications@github.com wrote:
Hello, say I have an application with 5 pages (= 5 actual html files). Every page shows different things, so every page should have its corresponding ViewModel (= Vue instance).
How should I structure the files of my project? Should every VM have its own file and then every page will reference the appropriate one? Or should I bundle all the Vue definitions in a single file and then Vue itself will decide if the el option actually exists.
Thanks
— Reply to this email directly or view it on GitHub https://github.com/vuejs/Discussion/issues/413.
I've already read that page, but I couldn't find an answer or suggested strategy about my questions
@matteocontrini if you have separate pages and each of your vm does different things, then yeah, one file for each vm instance.
Hello, say I have an application with 5 pages (= 5 actual html files). Every page shows different things, so every page should have its corresponding ViewModel (= Vue instance).
How should I structure the files of my project? Should every VM have its own file and then every page will reference the appropriate one? Or should I bundle all the Vue definitions in a single file and then Vue itself will decide if the
el
option actually exists?Thanks