码迷,mamicode.com
首页 > Web开发 > 详细

jade模版js中接收express的res.render

时间:2019-01-21 19:31:28      阅读:210      评论:0      收藏:0      [点我收藏+]

标签:route   type   you   com   extends   ons   UNC   function   func   

router:

router.get(‘/‘, function(req, res, next) {
res.render(‘index‘, { title:{name:‘aaa‘,age:23} });
});

 

jade:

extends layout

block content
h1= title
p Welcome to #{title.name}

script(type="text/javascript").
var title = !{JSON.stringify(title)}
console.log(title.name)

 

在vue中也可以用js接收

jade模版js中接收express的res.render

标签:route   type   you   com   extends   ons   UNC   function   func   

原文地址:https://www.cnblogs.com/qiyc/p/10300158.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!