Skip to content

Commit a441bd5

Browse files
committed
fix: ts operator & chinese anchor bug; type challenges for guide reference
1 parent b30964d commit a441bd5

File tree

4 files changed

+40
-20
lines changed

4 files changed

+40
-20
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# [1.0.0](https://github.com/Rain120/typescript-guide/compare/0.0.1...1.0.0) (2021-02-09)
1+
# [1.0.0](https://github.com/Rain120/typescript-guide/compare/0.0.1...1.0.0) (2021-03-12)
22

33

44
### Bug Fixes
@@ -10,6 +10,7 @@
1010

1111
* blog tips & pdfs & books ([310765f](https://github.com/Rain120/typescript-guide/commit/310765ffd4e95bcde3dc3a33c3ca7115f80d30f1))
1212
* faqs about tsconfig module target ([d40988c](https://github.com/Rain120/typescript-guide/commit/d40988c26b6c287dc72aac94a4c76b2f07cfa8cf))
13+
* finished declaration ([b30964d](https://github.com/Rain120/typescript-guide/commit/b30964d056cd2c03bcaa0dd3a19a60215510ec90))
1314
* tsconfig - references ([ad24a19](https://github.com/Rain120/typescript-guide/commit/ad24a197efd8703ab818458246d141b3adf5f226))
1415
* tsconfig module target; remove faqs module, target ([48d3e0f](https://github.com/Rain120/typescript-guide/commit/48d3e0f16f0957b08da24352ca73eb1e5770d382))
1516

docs/.vuepress/enhanceApp.js

Lines changed: 29 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,38 @@
22
* @Author: Rainy
33
* @Date: 2020-02-27 16:38:27
44
* @LastEditors: Rainy
5-
* @LastEditTime: 2020-02-27 17:28:53
5+
* @LastEditTime: 2021-03-12 16:16:16
66
*/
77

88
// import copy from './utils/copy';
99

1010
export default ({ Vue, options, router, siteData, isServer }) => {
11-
setTimeout(() => {
12-
try {
13-
//对document的判断是防止编译的时候报错
14-
document &&
15-
(() => {
16-
// copy();
17-
})();
18-
} catch (e) {
19-
console.error(e.message);
20-
}
21-
}, 500);
11+
if (typeof process === 'undefined' || process.env.VUE_ENV !== 'server') {
12+
router.onReady(() => {
13+
const { app } = router;
14+
15+
app.$once('hook:mounted', () => {
16+
setTimeout(() => {
17+
const { hash } = document.location;
18+
if (hash.length > 1) {
19+
const id = decodeURIComponent(hash.substring(1));
20+
const element = document.getElementById(id);
21+
element && element.scrollIntoView();
22+
}
23+
}, 500);
24+
});
25+
});
26+
}
27+
28+
setTimeout(() => {
29+
try {
30+
//对document的判断是防止编译的时候报错
31+
document &&
32+
(() => {
33+
// copy();
34+
})();
35+
} catch (e) {
36+
console.error(e.message);
37+
}
38+
}, 500);
2239
};

docs/zh/operator/README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ console.log(getName);
114114

115115
[非null断言运算符](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-0.html#non-null-assertion-operator)
116116

117-
## ?
117+
## ? 运算符
118118

119119
- 定义属性用于 **可选属性定义**
120120

@@ -129,7 +129,7 @@ interface Profile {
129129

130130
- 使用属性用于 **可选的属性访问**
131131

132-
### ?.
132+
### ?. 运算符
133133

134134
**?.** 只会检查其左侧的值是否为 `null``undefined`, 而不检查任何后续属性。
135135

@@ -149,7 +149,7 @@ const x = (foo === null || foo === undefined)
149149

150150
[Announcing TypeScript 3.7 RC](https://devblogs.microsoft.com/typescript/announcing-typescript-3-7-rc/) -> [译文](https://www.infoq.cn/article/d95pGayR9s4eucUGKSFP)
151151

152-
### ??
152+
### ?? 运算符
153153

154154
**空值合并运算符** 是即将推出的另一个 `ECMAScript 2020`功能, 它与可选的链接并驾齐驱。
155155

@@ -167,7 +167,7 @@ let x = (foo !== null && foo !== undefined)
167167

168168
[nullish-coalescing](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-7.html#nullish-coalescing)
169169

170-
## + -
170+
## + - 运算符
171171

172172
`TypeScript 2.8` 为映射类型增加了增加或移除特定修饰符的能力。 特别地, 映射类型里的`readonly``?`属性修饰符现在可以使用`+``-`前缀, 来表示修饰符是添加还是移除。
173173

@@ -182,7 +182,7 @@ type ReadonlyPartial<T> = {
182182

183183
[改进对映射类型修饰符的控制](http://www.tslang.cn/docs/release-notes/typescript-2.8.html)
184184

185-
## _
185+
## _ 运算符
186186

187187
TypeScript 2.7支持ECMAScript的数字分隔符提案。 这个特性允许用户在数字之间使用下划线(_)来对数字分组(就像使用逗号和点来对数字分组那样)。
188188

@@ -205,7 +205,7 @@ let martin = 0xF0_1E_
205205

206206
[数字分隔符](https://www.tslang.cn/docs/release-notes/typescript-2.7.html)
207207

208-
## \#
208+
## \# 运算符
209209

210210
TypeScript 3.8 支持在 ECMAScript 中处于 [stage-3](https://github.com/tc39/proposal-class-fields/) 中的私有字段。
211211

@@ -454,4 +454,4 @@ _name = new WeakMap();
454454

455455
[ECMAScript feature: numeric separators](https://2ality.com/2018/02/numeric-separators.html)
456456

457-
[细数 TS 中那些奇怪的符号](https://www.yuque.com/arvinxx-fe/typescript/dfe2722f-0c2a-4189-b2c5-de128f85d40f#d958e3d1)
457+
[细数 TS 中那些奇怪的符号](https://www.yuque.com/arvinxx-fe/typescript/dfe2722f-0c2a-4189-b2c5-de128f85d40f#d958e3d1)

docs/zh/what-is-typescript/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,3 +82,5 @@ tsc hello_world.ts
8282
[未来可期的 TypeScript](https://mp.weixin.qq.com/s?__biz=MzIxNjgwMDIzMA==&mid=2247485103&idx=1&sn=9063e21d824db34820e955967c5a8ea3&scene=21#wechat_redirect)
8383

8484
[非官方中文版](http://s0www0typescriptlang0org.icopy.site/index.html)
85+
86+
[type-challenges](https://github.com/type-challenges/type-challenges)

0 commit comments

Comments
 (0)