We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
globalName
$nuxt
1 parent 7dec0a0 commit fd1f8ecCopy full SHA for fd1f8ec
lib/plugin.js
@@ -2,6 +2,8 @@ import Axios from 'axios'
2
import defu from 'defu'
3
<% if (options.retry) { %>import axiosRetry from 'axios-retry'<% } %>
4
5
+const globalName = '<%= globalName %>'
6
+
7
// Axios.prototype cannot be modified
8
const axiosExtra = {
9
setBaseURL (baseURL) {
@@ -126,7 +128,7 @@ const setupProgress = (axios) => {
126
128
set: () => { }
127
129
}
130
- const $loading = () => (window.$nuxt && window.$nuxt.$loading && window.$nuxt.$loading.set) ? window.$nuxt.$loading : noopLoading
131
+ const $loading = () => (window[globalName] && window[globalName].$loading && window[globalName].$loading.set) ? window[globalName].$loading : noopLoading
132
133
let currentRequests = 0
134
0 commit comments