In order to learn new technology, it is never enough just to see without, so I decided to use Vue3+Vite2 to do a simple background management project; This includes login, layout, a few table pages, and a few charts.
The development tools
I use vscode + Volar plug-in. First of all, Volar does not have vue3 syntax hints for the use of the editor, which adds some difficulty to the development of lazy people like me, and I need to constantly check the documents. The only nice thing about this plugin is that you can split.vue files into three Windows with one click.
Development of language
This is one of my regrets because I’ve been developing in JavaScript so I thought I’d start with Vue3+JS, but Vue3’s big advantage is TypeScript support, so I’ll probably consider using TS for refactoring later.
Experience of using Vue3
advantages
The following statements all assume implementation in the Setup syntax sugar
- After a component is referenced, no registration is required
- Without the
data
methods
Wait for the hook function to switch back and forth, but be carefulScope of a variable - Never mind that the component needs a unique root element
- Vite starts compiling quickly, and changes to configuration files restart automatically
- Vue3 supports the use of JS variables in CSS
disadvantages
- Each time you edit a new file, you need to introduce the required API, for example
ref
onMounted
等 - (This is for people like me who use open source) feel supported
Vue3
The documentation for the open source framework is not very friendly - There is a requirement for the Node environment, which requires a node version greater than 12 to be packaged. This is not a disadvantage, but our container environment does not support it at the moment, which is annoying.
conclusion
This is just my experience, and I will try out the composite API and keep updating it.