Skip to content

Commit 2265f49

Browse files
committed
feat: adjust text
1 parent e9c0ddc commit 2265f49

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

README.md

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,14 @@ vue create vue-next-project
5656

5757
这里在输入命令后,需要选择`Manually select features`, 至少要把 `babel` `typescript` `router` 选上,(`vuex` 看自身情况是否需要)。如下图:
5858

59-
![](https://user-gold-cdn.xitu.io/2020/5/22/1723b9c80913e36d?w=566&h=237&f=png&s=9590)
59+
![](https://github.com/vue3/vue3/vue3-router4-typescript/raw/master/assets/vue create project.png)
6060

6161
不清楚 vue-cli 的可参考[文章](https://juejin.im/post/5e69de93f265da570c75453e)
6262

6363
#### 3、升级为 vue3.x 项目
6464

65+
https://github.com/vuejs/vue-cli-plugin-vue-next
66+
6567
```
6668
cd vue-next-project
6769
vue add vue-next
@@ -73,8 +75,6 @@ vue add vue-next
7375

7476
接下来需要简单处理一下,使其支持 typescript 形式。(模板 cli 还没完善 typescript 的模板代码)
7577

76-
![](https://user-gold-cdn.xitu.io/2020/5/22/1723bb003f8fc297?w=965&h=520&f=png&s=30033)
77-
7878
-`shims-vue.d.ts`文件中的内容修改一下,这步操作应该会少了一些报错。
7979

8080
```
@@ -136,7 +136,18 @@ export default defineComponent({
136136
```
137137

138138
生命周期对应
139-
![](https://user-gold-cdn.xitu.io/2020/5/22/1723bc18105dcd9f?w=488&h=319&f=png&s=15352)
139+
140+
与 2.x 版本生命周期相对应的组合式 API
141+
142+
beforeCreate → 使用 setup()
143+
created → 使用 setup()
144+
beforeMount → onBeforeMount
145+
mounted → onMounted
146+
beforeUpdate → onBeforeUpdate
147+
updated → onUpdated
148+
beforeDestroy → onBeforeUnmount
149+
destroyed → onUnmounted
150+
errorCaptured → onErrorCaptured
140151

141152
### 四、附上学习 vue-next 与 typescript 的官方秘籍
142153

assets/vue create project.png

33.4 KB
Loading

0 commit comments

Comments
 (0)