# 2020.01.06 今天是每日时报陪伴您的第 299 天

[文章] 每一位开发者都应该知道的 ES2018 新特性:https://css-tricks.com/new-es2018-features-every-javascript-developer-should-know/ (opens new window)

[文章] 如何进行 Web 性能监控:http://www.alloyteam.com/2020/01/14184/ (opens new window)

[工具] RunJS 是一个 JS 实验室调试工具,适用于实验、截图、屏幕录制等场景:https://runjs.dev/ (opens new window)

[资源] Vue 3(alpha) 官方的演示 Demo:https://github.com/vuejs/vue-next-webpack-preview (opens new window)

[类库] extend2 可以用简单的方式实现深度克隆:https://github.com/eggjs/extend2 (opens new window)

[类库] 可以将 Windows 的反斜杠路径,转换成斜杠路径:https://github.com/sorrycc/slash2 (opens new window)

# 配图 - 如何进行 Web 性能监控

# 示例 - Vue

<template>
  <img src="./logo.png">
  <h1>Hello Vue 3!</h1>
  <button @click="inc">Clicked {{ count }} times.</button>
</template>

<script>
import { ref } from 'vue'
export default {
  setup() {
    const count = ref(0)
    const inc = () => {
      count.value++
    }
    return {
      count,
      inc
    }
  }
}
</script>

<style scoped>
img {
  width: 200px;
}
h1 {
  font-family: Arial, Helvetica, sans-serif;
}
</style>

# 示例 - ES2018 新特性

fetch("https://www.google.com")
  .then(response => {
    console.log(response.status);
  })
  .catch(error => {
    console.log(error);
  })
  .finally(() => {
    document.querySelector("#spinner").style.display = "none";
  });

# 示例 - slash

const path = require("path");
const slash = require("slash");

const str = path.join("foo", "bar");
// Unix    => foo/bar
// Windows => foo\\bar

slash(str);
// Unix    => foo/bar
// Windows => foo/bar

# 示例 - extend2

const extend = require("extend2");

// for deep clone
extend(true, {}, object1, objectN);
Last Updated: 1/6/2020, 7:27:21 PM