Skip to content
Permalink
Browse files
fix(plugin): use globalName instead of $nuxt (fixes #345)
  • Loading branch information
pooya parsa committed Apr 21, 2020
1 parent 7dec0a0 commit fd1f8ec17160f6e88610e3dfa2153423b3140592
Showing 1 changed file with 3 additions and 1 deletion.
@@ -2,6 +2,8 @@ import Axios from 'axios'
import defu from 'defu'
<% if (options.retry) { %>import axiosRetry from 'axios-retry'<% } %>

const globalName = '<%= globalName %>'

// Axios.prototype cannot be modified
const axiosExtra = {
setBaseURL (baseURL) {
@@ -126,7 +128,7 @@ const setupProgress = (axios) => {
set: () => { }
}

const $loading = () => (window.$nuxt && window.$nuxt.$loading && window.$nuxt.$loading.set) ? window.$nuxt.$loading : noopLoading
const $loading = () => (window[globalName] && window[globalName].$loading && window[globalName].$loading.set) ? window[globalName].$loading : noopLoading

let currentRequests = 0

0 comments on commit fd1f8ec

Please sign in to comment.