Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用 Vue.js 开发一个更大的应用程序,我一直想知道是否有更好的方法来组织和重用 ajax 请求。目前,应用程序只是在组件内进行调用(这是好的做法吗?)。我来自 Angular,我基本上想知道是否有工厂或服务的替代品?
Vue 没有为此提供任何特殊功能。推荐的方法是简单地构建您自己的模块并在需要它们的地方使用它们。