第64期 — 2020-07-19

在浏览器中阅读

周e信

扫描二维码关注微信公众号

Node.js

Jeff Barczewski

hapi 仍将继续🔗

上次(原推已被删)说年底会关闭,现在又说 2021 将继续

devin ivy

前端

rich - router react路由,从react-router演进🔗

作者之一也是 react-router 的作者

import React from "react";
import { render } from "react-dom";
import { Router, Link } from "@reach/router";

let Home = () => <div>Home</div>;
let Dash = () => <div>Dash</div>;

render(
  <Router>
    <Home path="/" />
    <Dash path="dashboard" />
  </Router>
);

Reach

Gábor Soós

投稿

窍门-使用localStorage记住滚动条位置🔗
let sidebar = document.querySelector(".sidebar");

let top = localStorage.getItem("sidebar-scroll");
if (top !== null) {
  sidebar.scrollTop = parseInt(top, 10);
}

window.addEventListener("beforeunload", () => {
  localStorage.setItem("sidebar-scroll", sidebar.scrollTop);
});

Chris Coyier

Oscar deulos

Toolforge

Tabler

人工智能

Brown HCI Research Group

扫描二维码关注微信公众号
本期阅读量