fix(vue-app): sanitizeComponent import regression with features disabled (#7271)

This commit is contained in:
Kevin Marrec 2020-04-24 18:05:55 +02:00 committed by GitHub
parent 1ce8041abe
commit e089ac649f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,13 +1,16 @@
import Vue from 'vue'
<% if (features.asyncData || features.fetch) { %>
import {
getMatchedComponentsInstances,
getChildrenComponentInstancesUsingFetch,
promisify,
globalHandleError,
sanitizeComponent
} from './utils'
<% } %>
<% utilsImports = [
...(features.asyncData || features.fetch) ? [
'getMatchedComponentsInstances',
'getChildrenComponentInstancesUsingFetch',
'promisify',
'globalHandleError'
] : [],
...features.layouts ? [
'sanitizeComponent'
]: []
] %>
<% if (utilsImports.length) { %>import { <%= utilsImports.join(', ') %> } from './utils'<% } %>
<% if (features.layouts && components.ErrorPage) { %>import NuxtError from '<%= components.ErrorPage %>'<% } %>
<% if (loading) { %>import NuxtLoading from '<%= (typeof loading === "string" ? loading : "./components/nuxt-loading.vue") %>'<% } %>
<% if (buildIndicator) { %>import NuxtBuildIndicator from './components/nuxt-build-indicator'<% } %>