Skip to content

Commit

Permalink
v1.3.5
Browse files Browse the repository at this point in the history
  • Loading branch information
xugaoyi committed Jul 4, 2020
1 parent a77a24d commit 450f621
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 8 deletions.
6 changes: 3 additions & 3 deletions docs/《ES6 教程》笔记/03.变量的解构赋值.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ tags:

### 基本用法

ES6 允许按照一定模式,从数组和对象中提取值,对变量进行赋值,这被称为解构(Destructuring)。
ES6 允许按照一定模式,**从数组和对象中提取值,对变量进行赋值,这被称为解构**(Destructuring)。

以前,为变量赋值,只能直接指定值。

Expand Down Expand Up @@ -66,7 +66,7 @@ let [bar, foo] = [1];

以上两种情况都属于解构不成功,`foo`的值都会等于`undefined`

另一种情况是不完全解构,即等号左边的模式,只匹配一部分的等号右边的数组。这种情况下,解构依然可以成功。
另一种情况是**不完全解构**,即等号左边的模式,只匹配一部分的等号右边的数组。这种情况下,解构依然可以成功。

```javascript
let [x, y] = [1, 2, 3];
Expand Down Expand Up @@ -132,7 +132,7 @@ let [x, y = 'b'] = ['a']; // x='a', y='b'
let [x, y = 'b'] = ['a', undefined]; // x='a', y='b'
```

注意,ES6 内部使用严格相等运算符(`===`),判断一个位置是否有值。所以,只有当一个数组成员严格等于`undefined`,默认值才会生效。
注意,ES6 内部使用严格相等运算符(`===`),判断一个位置是否有值。所以,只有 **当一个数组成员严格等于`undefined`,默认值才会生效**

```javascript
let [x = 1] = [undefined];
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"vuepress-plugin-one-click-copy": "^1.0.2",
"vuepress-plugin-thirdparty-search": "^1.0.2",
"vuepress-plugin-zooming": "^1.1.7",
"vuepress-theme-vdoing": "^1.3.4",
"vuepress-theme-vdoing": "^1.3.5",
"yamljs": "^0.3.0"
},
"dependencies": {
Expand Down
12 changes: 11 additions & 1 deletion theme-vdoing/layouts/Layout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,17 @@ export default {
this.setBodyClass()
},
mounted () {
this.showSidebar = true // 解决移动端初始化页面时侧边栏闪现的问题
// 初始化页面时链接锚点无法跳转到指定id的解决方案
const hash = document.location.hash;
if (hash.length > 1) {
const id = decodeURIComponent(hash.substring(1))
const element = document.getElementById(id)
if (element) element.scrollIntoView()
}
// 解决移动端初始化页面时侧边栏闪现的问题
this.showSidebar = true
this.$router.afterEach(() => {
this.isSidebarOpenOfclientWidth()
})
Expand Down
2 changes: 1 addition & 1 deletion theme-vdoing/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vuepress-theme-vdoing",
"version": "1.3.4",
"version": "1.3.5",
"description": "Vdoing theme for VuePress. 一个基于VuePress的知识管理兼博客主题。",
"author": {
"name": "gaoyi(Evan) Xu"
Expand Down
4 changes: 2 additions & 2 deletions theme-vdoing/styles/code.styl
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ div[class*="language-"]
width 100%
line-height 1.4
.highlighted
background-color rgba(0, 0, 0, 66%)
background-color rgba(0, 0, 0, 30%)
pre, pre[class*="language-"]
background transparent
position relative
Expand Down Expand Up @@ -70,7 +70,7 @@ div[class*="language-"]
display block
width $lineNumbersWrapperWidth
height 100%
background-color rgba(0, 0, 0, 66%)
background-color rgba(0, 0, 0, 30%)
pre
padding-left $lineNumbersWrapperWidth + 1 rem
vertical-align middle
Expand Down

0 comments on commit 450f621

Please sign in to comment.