我用vue写一个单页面应用,首页通过jade渲染,发现jade中的内联script无法渲染。入口main.js:import Vue from 'vue';import App from './components/App.vue';import Home from './components/Home.vue';import Log from '.
/components/Log.vue';import Post from './components/Post.vue';const VueRouter = require('vue-router');
Vue.use(VueRouter);let router = new VueRouter();
router.map({ "/log":{
component:Log
}, "/home":{
component:Home
}, "/post":{
component:Post
}
});
router.start(App,"#app");App.vue:<template>
<div>
那个这是app <router-view></router-view>
</div></template><script>
import Home from './Home.vue'; export default {
}</script>jade:extends layout
block content div(id="app") script.
window.user = {name:"hello"} script(src="/js/manifest.484c579ca98fb1764a3a.js")
script(src="/js/vendor.201036e726b2d5032b38.js") script(src="/js/app.829bb3b3b0bced220d35.js")最终渲染却没有这句内联的window.user...请问这是怎么回事呢?vue的方式出现的这个问题,我测试不用vue就正常渲染
添加回答
举报
0/150
提交
取消