v1.3.5
This commit is contained in:
parent
a77a24d119
commit
450f6215d3
|
|
@ -14,7 +14,7 @@ tags:
|
|||
|
||||
### 基本用法
|
||||
|
||||
ES6 允许按照一定模式,从数组和对象中提取值,对变量进行赋值,这被称为解构(Destructuring)。
|
||||
ES6 允许按照一定模式,**从数组和对象中提取值,对变量进行赋值,这被称为解构**(Destructuring)。
|
||||
|
||||
以前,为变量赋值,只能直接指定值。
|
||||
|
||||
|
|
@ -66,7 +66,7 @@ let [bar, foo] = [1];
|
|||
|
||||
以上两种情况都属于解构不成功,`foo`的值都会等于`undefined`。
|
||||
|
||||
另一种情况是不完全解构,即等号左边的模式,只匹配一部分的等号右边的数组。这种情况下,解构依然可以成功。
|
||||
另一种情况是**不完全解构**,即等号左边的模式,只匹配一部分的等号右边的数组。这种情况下,解构依然可以成功。
|
||||
|
||||
```javascript
|
||||
let [x, y] = [1, 2, 3];
|
||||
|
|
@ -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];
|
||||
|
|
|
|||
|
|
@ -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": {
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
})
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue