Vuejs Application Home Page Renders Problems via jade

  node.js, question

I used vue to write a Single page application. The first page was rendered by jade. I found that the inline script in jade could not be rendered.

Entry 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
 bracket
 });
 
 router.start(App,"#app");

App.vue:

<template>
 <div>
 This is app
 <router-view></router-view>
 </div>
 </template>
 
 <script>
 import Home from './Home.vue';
 export default {
 bracket
 </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")

The final rendering did not include this inline window.user …

clipboard.png

May I ask what is going on here? This problem occurred in vue’s way, and I tested the normal rendering without vue.

Can jade recognize that. vue files and ecma6 escape to ecma5?

  • Jade has never been used. I packed it with the webpack.