We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
相对于 Vue2.x 中 Options API 的组织方式,Composition API 按照功能去区分代码模块,时一个功能所定义的所有API 放在一起,从而达到 高内聚、低耦合 的目的
首先,所谓 Options API 时在Vue2.x中定义的处理页面逻辑的代码框架
// *.vue 文件 export default { data() { return{} }, methods: {}, computed: {}, watch: {}, }
这种组织形式的特点可以总结为:按照其分工来组织代码,在结构上非常清晰。但是缺点也比较明显,当页面的复杂度足够高时,data 和 methods中的变量和方法过多,使代码维护成本增加。(See Figure.1)
按照功能模块来划分代码结构,使代码结构变的更加清晰,数据来源更加清晰。
The text was updated successfully, but these errors were encountered:
No branches or pull requests
特性1: Composition API
相对于 Vue2.x 中 Options API 的组织方式,Composition API 按照功能去区分代码模块,时一个功能所定义的所有API 放在一起,从而达到 高内聚、低耦合 的目的
Options API
首先,所谓 Options API 时在Vue2.x中定义的处理页面逻辑的代码框架
这种组织形式的特点可以总结为:按照其分工来组织代码,在结构上非常清晰。但是缺点也比较明显,当页面的复杂度足够高时,data 和 methods中的变量和方法过多,使代码维护成本增加。(See Figure.1)
Composition API
按照功能模块来划分代码结构,使代码结构变的更加清晰,数据来源更加清晰。
The text was updated successfully, but these errors were encountered: