@nuxt/vue-app
Advanced tools
Comparing version 2.12.0 to 2.12.1
/*! | ||
* @nuxt/vue-app v2.12.0 (c) 2016-2020 | ||
* @nuxt/vue-app v2.12.1 (c) 2016-2020 | ||
@@ -4,0 +4,0 @@ * - All the amazing contributors |
{ | ||
"name": "@nuxt/vue-app", | ||
"version": "2.12.0", | ||
"version": "2.12.1", | ||
"repository": "nuxt/nuxt.js", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -7,3 +7,4 @@ import Vue from 'vue' | ||
promisify, | ||
globalHandleError | ||
globalHandleError, | ||
sanitizeComponent | ||
} from './utils' | ||
@@ -27,3 +28,3 @@ <% } %> | ||
const layouts = { <%= Object.keys(layouts).map(key => `"_${key}": _${hash(key)}`).join(',') %> }<%= isTest ? '// eslint-disable-line' : '' %> | ||
const layouts = { <%= Object.keys(layouts).map(key => `"_${key}": sanitizeComponent(_${hash(key)})`).join(',') %> }<%= isTest ? '// eslint-disable-line' : '' %> | ||
@@ -30,0 +31,0 @@ <% if (splitChunks.layouts) { %>let resolvedLayouts = {}<% } %> |
@@ -55,4 +55,12 @@ import Vue from 'vue' | ||
async function $fetch() { | ||
this.$nuxt.nbFetching++ | ||
function $fetch() { | ||
if (!this._fetchPromise) { | ||
this._fetchPromise = $_fetch.call(this) | ||
.then(() => { delete this._fetchPromise }) | ||
} | ||
return this._fetchPromise | ||
} | ||
async function $_fetch() { | ||
this.<%= globals.nuxt %>.nbFetching++ | ||
this.$fetchState.pending = true | ||
@@ -79,4 +87,4 @@ this.$fetchState.error = null | ||
this.$nextTick(() => this.$nuxt.nbFetching--) | ||
this.$nextTick(() => this.<%= globals.nuxt %>.nbFetching--) | ||
} | ||
@@ -83,3 +83,3 @@ import Vue from 'vue' | ||
} | ||
// For debugging purpose | ||
// If no component name defined, set file path as name, (also fixes #5703) | ||
if (!Component.options.name && Component.options.__file) { | ||
@@ -642,3 +642,5 @@ Component.options.name = Component.options.__file | ||
} | ||
vm.$options[hook].push(fn) | ||
if (!vm.$options[hook].includes(fn)) { | ||
vm.$options[hook].push(fn) | ||
} | ||
} |
146124
3031