1. Project directory structure
vue-cli2.0 And 3.0 In the aspect of directory structure , There are obvious differences
vue-cli3.0 Removed profile directory ,config and build folder
Also removed static Static folder , Added public folder , Open the hierarchical directory and you will find , index.html Move to public in
2. Configuration item
3.0 config The file has been removed , But there are too many .env.production and env.development file , Except for the file location , The actual configuration and 2.0 It's no different
be without config file , When domain name needs to be configured across domains , from config/index.js Moved to vue.config.js in , The configuration method remains unchanged
3. Rendering
Vue2.x Used Virtual Dom Rendering of the implementation
Vue3.0 Whether it's native or not html Label or vue assembly , They will all pass h Function , If it's native html label , Directly through the Virtual
Dom To render directly , Similarly, if it is a component, it will generate component code directly
4. Data monitoring
Vue2.x As we all know, we use es5 Of object.defineproperties in getter and setter Realized , and vue3.0 Version of , It's based on Proxy To monitor , In fact, based on proxy Monitoring is what we call lazy
by default, What do you mean , It's only when you use it that you'll listen , It can be understood as ‘ Monitor on demand ’, The official interpretation is : doppio movimento , At the same time, the memory consumption is halved .
4. On demand introduction
Vue2.x in new The instance object of the , Everything is here vue Object , In fact, whether you use it or not , It's going to change . and vue3.0 Can be used in ES module
imports On demand introduction , as :keep-alive Built in components ,v-model instructions , wait .
Technology