I'm starting to learn Vue.js and I am wondering why in all tutorials I've seen so far the routes are defined in the file src/router/index.js
or src/router/index.ts
. Is this just a style convention or does it have a deeper meaning?
As the router folder only contains a single file, I thought it would be nicer to define the routes for example in src/routes.js
and import it in the main.js
file, any drawbacks of this approach?
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…