bluefox1688 / vue-cli-multi-page

因时间精力有限,项目已不再维护,请慎重使用,vue2-cli-vux2-multe-page,使用了webpack2+vuejs2+vuxUI2的多页面脚手架
829 stars 239 forks source link

大神不能在 views 下新添页面吗 #15

Closed hanhao0125 closed 4 years ago

hanhao0125 commented 7 years ago

如题,前端新手,不太懂 webpack加载方式,我在 views 下面新添页面,在run 时没有加载我新建的文件

bluefox1688 commented 7 years ago

可以,你新增页面之后,需要重新npm run dev

hanhao0125 commented 7 years ago

我重新 run 了,没有加载

bluefox1688 commented 7 years ago

有提示什么吗?

hanhao0125 commented 7 years ago

image 我把 views 改成了 edu,我在其下新建了文件夹 student,但是启动过程没看到加载这个文件夹下的文件啊

bluefox1688 commented 7 years ago

修改了/config/index.js里的模块名了没有?

hanhao0125 commented 7 years ago

修改了,其他都是正常的

hanhao0125 commented 7 years ago

我刚才访问了一下那个地址,竟然可以访问!!!

hanhao0125 commented 7 years ago

不过 vue 没起作用。。。

bluefox1688 commented 7 years ago

你新建的模块下有一个xxx.js文件,打开之后有一个import App from './listApp'类似这样的,你需要把listApp对应修改为vue名

hanhao0125 commented 7 years ago

可以的,我刚才复制了home,修改名字后是可以正常访问的

hanhao0125 commented 7 years ago

这个要求一个页面对应一个文件夹吗?我想分模块,例如购物模块下有选择商品和付账两个页面,能放在一个文件下吗?

bluefox1688 commented 7 years ago

必须一个页面对应一个文件夹,你可以建一个一级文件夹,二级就都放商品和付款页

hanhao0125 commented 7 years ago

可以。这个已经集成了 axios 吗?我一开始用的 vue-resource,在网上看到说 axios 貌似更好用?大神怎么看?

bluefox1688 commented 7 years ago

推荐用axios

hanhao0125 commented 7 years ago

好的,多谢大神。多谢多谢!!