ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
### 1\. 注册全局方法(main.js) > 假设已有`/common/httpRequest.js` ~~~ import HttpRequest from './common/httpRequest' Vue.prototype.$Request = HttpRequest; const app = new Vue({ ...App }); app.$mount(); ~~~ ### 2\. test.vue 使用 ~~~ <script> export default { data() { return { title: 'Hello' } }, onLoad() { this.loadBanner(); }, methods: { loadBanner: function() { this.$Request.get('/tao/banner/user/list').then(res => { if (res.status === 0) { this.banners = res.data; } }); }, } } </script> ~~~