对象字面量
const a = new Object();
对象字面量
const a = {};
属性增强写法
es5
const a = '123' const obj = { a:a }
es6
const a = '123' const obj = { a } // 属性从同名变量找
函数增强写法
es5
`
const a = {
a:function(){
}
}
`
es6
`
const a = {
a(){
}
}
`
字符串模版
const skill = '安邦' const david =
文能${skill}
ES6对象键计算表达式
var heat = '50%'; var field = 'Rock and Roll'; var music = { [field.toLowerCase()]: heat } console.log(music); // Object {rock and roll: "50%"}
对象解构
let music = { type: 'rock', heat: '50%' }; let { type, heat } = music; console.log(type, heat); // rock 50%
对象解构 重命名
let music = { type: 'rock', heat: '50%' } let { type: aaa, heat: bbb } = music; console.log(aaa, bbb); // rock 50%
数组解构
let people = [20, 25, 30] let [young, oldYoung] = people; console.log(young, oldYoung) // 20 25
covid 2020 10 03
笔记
战斗机
https://zh.wikipedia.org/wiki/%E6%AD%BC-10
11 15 16 20 35 22
mac Add The Recent Items Stack To The Dock
1 | defaults write com.apple.dock persistent-others -array-add '{ "tile-data" = {"list-type" = 1; }; "tile-type" = "recents-tile";}' && \killall Dock |
signal
手机扫描二维码 藏在 设置 - 已关联设备
将 Signal Desktop 与手机关联的步骤:
安装并打开 Signal Desktop。
在你的手机上,打开信速达转到信速达的设置界面profile_avatar.png > 登录过的设备。
按下+图标(安卓)或是”登录新的设备”(苹果)
用你的手机来扫描二维码。
选取一个你登录过的设备然后点击完成。
从 Signal Desktop 发送一条信息。
js array reduce
1 | var numbers = [15.5, 2.3, 1.1, 4.7]; |
1 | var numbers = [15.5, 2.3, 1.1, 4.7]; |
vue trigger component
简单粗暴
1 | <div id="parent"> |
总线
in main.js
1 | export const bus = new Vue() |
in Parent.vue:
1 | import {bus} from 'path/to/main' |
// Where you wanna call the child’s method:
1 | bus.$emit('customEventName', optionalParameter) |
in Child.vue:
1 | import {bus} from 'path/to/main' |
// Add this to the mounted() method in your component options object:
1 | bus.$on('customEventName', this.methodYouWannaCall) |
总线代码
1 | import ChildForm from './components/ChildForm' |
组件代码
1 | <template> </template> |
$attrs
组件内,返回 除 class style props 以外的 其他属性
1 | console.log(this.$attrs); |
$children
1 | console.log(this.$root.$children[0].$children[0].$data); |
$createElement:
$el:
$listeners:
$options:
$root:
$scopedSlots:
$slots:
$vnode:
event bus 多次触发
$on 的事件可在 created 或 mounted 注册
需在 beforeDestroy 或 destoryed 的时候使用用 $off 销毁
否则在某些情况下会被被多次触发
this.EventBus.$off(‘map_is_ready’);
全部 cancel
this.EventBus.$off();
vue cli customize domain
vue.config.js 中添加
1 | module.exports = { |
本机域名 在
/etc/hosts
how to download twitter video
比如这个页面: https://twitter.com/LQ0068/status/1265813100084604928
1. 找到视频地址
打开 Inspect - Network 控制面板
搜索 m3u ,找到 m3u 地址
2. 用 ffmpeg 下载 .m3u8 流媒体
在 bin 目录,执行命令
./ffmpeg -i https://video.twimg.com/ext_tw_video/1265812939941965825/pu/pl/320x458/fMnXob_apIlD45mw.m3u8 1.mp4
参考:
death reason
cardiovascular | 心血管的
cancer | 癌症
respiratory | 呼吸的
low respiratorty infection | 低呼吸道感染
demential | 痴呆的
digestive | 消化的
diabet | 糖尿病
liver | 肝
road injuries | 道路伤害
kidney disease | 肾脏疾病
tuberculosis | 结核
HIV/AIDS | HIV爱滋病
suicide | 自杀
malaria | 疟疾
homicide | 杀人
parkison | 帕金森
drowning | 淹死
meningit | 脑膜炎
nutritional deficiencies | 营养不足
protein-energy malnutrition | 蛋白质能量营养不良
maternal disorder | 产妇疾病
alcohol use disorder | 饮酒障碍
drug | 药品
conflict | 冲突
hepatities | 肝病
fire | 火
poisoning | 中毒
heat | 热
terrorism | 恐怖主义
natural disaster | 自然灾害
Diarrheal | 腹泻
Cardiovascular | 心血管的
Dementia | 痴呆
Tuberculosis | 结核
Diarrheal | 腹泻
Tuberculosis | 结核
smoke 抽烟
suicide 自杀
homicide 谋杀
input type radio readonly
1 | <h3>type=radio 的只读问题</h3> |