The solution to writing Vue without code hints in VSCode

When the blogger used Vue-CLI to create a Vue2.x project for the first time today, he found that there is no code prompt for Vue syntax in VSCode (Vue has been configured), so after searching the information on the Internet, he found that he needed to download a plug-in called " Vetur", the operation steps are shown in Figure 1:

Figure 1 Download plug-in steps

If after the plug-in is downloaded and installed, there is still no code prompt when writing the .vue file. At this time, you need to change the language mode of VSCode. The operation is shown in Figure 2:

Figure 2 Language Mode Settings

After the above two steps are completed, there will be a code template prompt, as shown in Figure 3:

Figure 3 code prompt success


2023.2.22 update

The Vetur plug-in is better adapted to the Vue2 project. The Vue3 project officially released a plug-in called Vue Language Features (Volar). As shown in Figure 4:

Figure 4 Volar plug-in installation process

But after my test, the two plug-ins only support word syntax prompts most of the time, Vetur only supports template creation when it is used outside the created tag, and Volar does not seem to support template creation? ! . And two plug-ins are installed at the same time, you need to disable one of them to use it normally.

Guess you like

Origin blog.csdn.net/qq_50564231/article/details/129102422