小编kal*_*lki的帖子

Angular 5.0变化检测策略VS React的变化检测策略

我理解变量检测在Angular 5.0中是如何工作的.

有人可以帮助我理解React中的相同功能以及它与Angular的不同之处是什么?

reactjs virtual-dom angular2-changedetection angular

8
推荐指数
2
解决办法
1676
查看次数

CSS 过渡不能反向工作

要求:我需要基于元素高度的平滑动画(由子元素驱动)

注意:请点击元素展开

JSFiddle:https : //jsfiddle.net/Lhmq0oqz/4/

我尝试过的:元素结构如下

document.querySelector('.parent').addEventListener('click', function(eve) {
  eve.currentTarget.className.indexOf('expand') == -1 ? eve.currentTarget.className = 'parent expand' : eve.currentTarget.className = 'parent';
});
Run Code Online (Sandbox Code Playgroud)
.parent {
  max-height: 200px;
  width: 400px;
  background-color: yellow;
  transition: max-height 1s ease;
  overflow: auto;
}
.child-wrap {
    width: 100%;
}
.child1 {
  width: 100%;
  background-color: green;
  transition: height 1s;
}

.child2 {
  height: 0px;
  width: 0px;
  background-color: red;
  transition: height 1s;
  
}
.parent.expand {
  max-height: 400px;
}
.expand .child-wrap{
  display:table
}
.expand .child2 …
Run Code Online (Sandbox Code Playgroud)

css animation css-animations

6
推荐指数
1
解决办法
2481
查看次数

用于快速路由器 url 的正则表达式以匹配以 /public/ 开头的路径

要求:需要匹配所有以/public/ token开头的url 。

我尝试过的:我尝试了下面的正则表达式来匹配所有以 /public/ 开头的路径

正则表达式: /\/public\/.*/

当我在 regex101 中使用它时,它能够匹配以 /public/ token 开头的 url

但是当在 Express 路由器测试器(http://forbeslindesay.github.io/express-route-tester/?_ga=1.180272292.1056934125.1459765156)中尝试相同时,它不起作用

任何人都可以帮助我知道它不起作用的原因!

示例代码:

我的期望是所有用 /public/ 令牌声明的 URL 都应该通过这条路线

router.route(/\/public\/.*/)
        .get(function(req, res, result){
            // TODO
        });
Run Code Online (Sandbox Code Playgroud)

例子:

https://localhost:8082/public/styles/styles.css
https://localhost:8082/public/js/rs.css
https://localhost:8082/public/images/qq.png
Run Code Online (Sandbox Code Playgroud)

regex url-routing node.js express

5
推荐指数
1
解决办法
6876
查看次数

想了解console.log.call.call.call.call.call.apply(a => a,[1,2])的代码流;

我知道调用和应用方法的工作原理,但是要问这个问题,让我理解流程有些棘手。有人可以帮我理解这一点。

console.log.call.call.call.call.call.apply(a => a, [1, 2]);
Run Code Online (Sandbox Code Playgroud)

javascript

-2
推荐指数
1
解决办法
103
查看次数