How to use Vue.prototype or global variable in Vue 3?
问题 Like the title, I want to add Axios into Vue prototype. So when I want to use it, I can use it like this.$axios instead of importing it every time. CODE: //plugins/axios.ts import axios from 'axios' import router from '../router/index' const errorHandle = (): void => {}; const instance = axios.create({ // baseURL: process.env.NODE_ENV == 'development' ? '' : '' baseURL: 'http://localhost:3000', timeout: 1000 * 12 }); instance.defaults.headers.post['Content-Type'] = 'application/x-www-form