vue 打印功能预览
As the summer winds down and we look ahead to fall, we also look ahead to the release of the next major version of the popular frontend framework VueJS. Presumably, their November conference will focus on the next major release of this ever-growing open-source project. In anticipation of the arrival of Vue 3.0, I’d like to go through a few of the changes that stood out to me for one reason or another: more efficiency, simplicity, reducing annoying problems, etc.
随着夏天的来临,我们期待秋天,我们也期待发布流行的前端框架VueJS的下一个主要版本。 大概他们11月的会议将集中讨论这个不断增长的开源项目的下一个主要版本。 期待Vue 3.0的到来,我想经历一下由于一个或另一个原因对我而言很突出的一些变化:提高效率,简化操作,减少烦人的问题等。
新成分API (New Composition API)
One of the first things that stood out to me is the addition of the entirely new Composition API, which will not be outright replacing the Options API that Vue 2.x components utilized but will presumably become the de facto design pattern for future Vue applications. To quote the development team’s reasoning behind this decision:
对我来说最突出的第一件事是添加了全新的Composition API,它不会完全取代Vue 2.x组件所使用的Options API,但可能会成为未来Vue应用程序的事实上的设计模式。 引用开发团队在此决定背后的推理:
“Organizing logics with component’s options (
data
,computed
,methods
,watch
) works in most cases. However, when our components get bigger, the list of logical concerns also grows. This can lead to components that are hard to read and understand, especially for people who d