Good news, the Chinese version of Vue3 official documentation is out!

When looking at the vue-composition-api document today, I suddenly found that there is an additional Languages ​​option:

Hey strange, I remember that there didn't seem to be this option before. Quickly click to see if there is any Chinese:
Insert picture description here

awesome! It was still very good to us, and I was moved to tears, although it is possible that he did not translate it at all.
Because in Zhihu, I once watched him post such a passage:
Insert picture description here
Of course it doesn’t matter whether he translated it or not. What’s important is that friends with poor English can finally take a closer look at the specific details of the composition-api of vue3!

Document address

https://composition-api.vuejs.org/zh/

Home page

Insert picture description here

What caught my eye was such a headline, which translated everything that shouldn't be translated, which made me wonder if it was translated by Google.
It's a bit uncomfortable to call a combined API, and the RFC is turned into a draft for comments. At first glance, it seems a bit confusing for the monk.

What is RFC

I believe that many friends are stunned when they hear this word, because this kind of words composed of several letters in all capitals is a capitalized spelling of several words with the first letter of each word, even if the English is very good. People cannot tell which words are the first letters by capitalizing the first letters of a few words. Unless you are often in a certain initial spelling environment, such as you like basketball, then you must know what the NBA is and if you like fighting, you must have heard of UFC ( You Yuxi is a UFC iron fan ). However, more people know the general meaning of the initials, but do not know the full spelling, such as: NBA, CBA, UFC, MMA, CCTV, etc. Most people know that NBA represents American basketball games, and CBA represents China. Basketball matches, UFC stands for American mixed martial arts competitions, MMA stands for mixed martial arts this sport, CCTV stands for CCTV, etc., but few people know their full martial arts.

Full fight of RFC

RFC is formed by concatenating the first letters of the three words Requests For Comment. If you look at the literal meaning, it can be translated into a request for comment . It still doesn't sound very well understood. What comment is requested? I have to be indifferent to make a comment, please? What about freedom of speech?

In fact, it has another relatively tall translation called: Request for Opinions. In this case, it is easier to understand, we not only want freedom, but also democracy!

Draft for comments

Now that I know the draft for comments, I have to mention "The Design Process of Vue3" . What kind of idea is this composition-api based on?
The official website has detailed instructions.

Try to use

Now that the Chinese documents are all out, there is no more reason to be lazy and say you can't learn.

Although some people are still more scrupulous, saying that what is still in the beta stage is unstable, and want to wait until the official version is released.

But in fact, the current api has stabilized, and the current work is to fix bugs. There will be nothing to add a new api or modify an existing api. It will not be a big problem to learn according to this document. .

In this case, you will use it ahead of time than the official version of vue3 before you learn it! There are so many articles on the blog now. What does the interviewer ask about? If you write on your resume that you are already proficient in vue3, wouldn’t it be a big plus?

So let's just start!

Creating a vue3 project is still very simple: refer to this article "Vue3 beta was released in the early hours of this morning, and it publicly supports the scaffolding project!

In short, there are two steps:

  1. vue create projectName
  2. vue add vue-next
  • It is best to use the latest version of @vue/cli4 scaffolding
  • Scaffolding like vue-cli2 cannot be created
  • Remember to upgrade vue scaffolding

Of course, when creating a vue project, do not choose typescript.

Because the vue-next plug-in does not support the ts project for the time being.

Well, since the creation is successful, I will tell you a few tips here. You can refer to the document to try vue3:

  • There is no new Vue() in the main file, instead createApp()
  • So there is no way to use the prototype chain to mount something on the vue root instance.
  • Replaced by dependency injection: provide and inject
  • Vue3 has made certain enhancements to provide and inject, which can replace the prototype chain mount
  • If you only want to use composition-api when defining components, you can use defineComponent(_ => {})
  • The function in defineComponent is equivalent to the setup function

Guess you like

Origin blog.csdn.net/GetIdea/article/details/106876084