ElemeFE / cooking

👨‍🍳 更易上手的前端构建工具
http://elemefe.github.io/cooking/
MIT License
1.94k stars 289 forks source link

关于style-scope跟vue-loader不生效以及vue-router设置html5模式后不能访问的问题 #156

Open zyanho opened 7 years ago

zyanho commented 7 years ago

cooking version

1.5.0 cooking init pages-vue from slush-cooking-pages-vue

What is Expected?

我引用了vue-router来做路由,然后有一个路径oauth下有 A for: oauth.html#/ B for: oauth.html#/connect/:type C for: oauth.html#/callback/:type

问题1:

然后,A有个style是设置body的底色,然后我如果在A的vue文件里面style上设置body的底色,B、C因为是同一个html也会有这样的底色,我希望A有底色,B、C没底色。

第一次尝试想通过vue的refs属性来修改,发现在index.tpl里面设置body的ref无效,只允许设置template里面的dom,此方法失败。

然后我搜索了vuejs的issue列表,看到官方说使用