V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX  ›  oct16  ›  全部回复第 2 页 / 共 2 页
回复总数  33
1  2  
2016-04-28 10:23:34 +08:00
回复了 jessynt 创建的主题 Vue.js Vue 2.0 发布了
刚入坑,看来又要重新学一遍了。
2016-03-15 09:23:14 +08:00
回复了 oct16 创建的主题 上海 大闵行莘庄地铁站次卧 1500
已出
2016-03-11 16:54:32 +08:00
回复了 huzhenghui37 创建的主题 上海 上海找 web 前端程序猿合作 H5+CSS+JS
就差程序员了
2016-03-11 16:54:07 +08:00
回复了 oct16 创建的主题 上海 大闵行莘庄地铁站次卧 1500
@zuoxiaomo 住的都是男生,避免不必要的麻烦。
2016-02-22 10:03:17 +08:00
回复了 anonymoustian 创建的主题 JavaScript JavaScript 对象,属性变成对象数组 求解。
var arr = [];
var obj = {a:1,b:2,c:3};
var temp;
for(var key in obj){
temp = {};
temp.name = key;
temp.value = obj[key];
arr.push(temp);
}
console.log(arr)
2016-01-14 10:58:37 +08:00
回复了 thinker3 创建的主题 程序员 有没有后端程序员成功掌握 css 的?求分享学习路径
你们确定 css 真简单吗?
R U Sure ?
2015-12-16 13:28:19 +08:00
回复了 oct16 创建的主题 macOS OS X 为毛不能用外置蓝牙
@primroses 和我的症状一样嘛,上次拿去旗舰店修,拆了我的蓝牙检测说没有问题又装了回来,啥问题也没解决。昨天一个上午丢失蓝牙没法工作也是无语了。现在不敢休眠了。
@xcv58 分辨率使用默认基本不会卡吧、
估计你是缩放了。
2015-08-24 22:04:32 +08:00
回复了 w88975 创建的主题 Node.js express + EJS 怎么给 layout template 加 controller?
我是比较简易的实现,改了下 express 的路由。
这样?

路由:
module.exports = function (app ) {
app.get ("/*", function (req, res, next ) {
toControl (req,res )
});

app.post ("/*", function (req, res, next ) {
toControl (req,res )
});

function toControl (req,res ){
var key = req.params['0'];
var control = require ('../controllers/' + key );
control (req,res );
}
}

controller :
var xxx = require ('../models/xxx.js');
module.exports = function (req,res ){
if (req.method == "GET"){
xxx.get ('xxxxx', function (err, xxx ) {
.........
res.render ( '<ejs path>', {
xxxx1 : 'xxxx',
xxxx2 : 'xxxx'
});
});
}else if (req.method == "POST"){
..........
}
};
1  2  
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5640 人在线   最高记录 6543   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 26ms · UTC 08:47 · PVG 16:47 · LAX 01:47 · JFK 04:47
Developed with CodeLauncher
♥ Do have faith in what you're doing.