Remove nuxt-container

This commit is contained in:
Sébastien Chopin 2016-12-24 17:58:52 +01:00
parent e3ebb6a54e
commit fcae73a79b
6 changed files with 15 additions and 27 deletions

View File

@ -1,7 +1,7 @@
<template> <template>
<nuxt-container> <div id="__nuxt">
<component v-if="layout" :is="layout"></component> <component v-if="layout" :is="layout"></component>
</nuxt-container> </div>
</template> </template>
<script> <script>
@ -14,6 +14,7 @@ layoutsKeys.forEach(function (key, i) { %>
} }
export default { export default {
head: <%= JSON.stringify(head) %>,
data: () => ({ data: () => ({
layout: null, layout: null,
layoutName: '' layoutName: ''
@ -46,3 +47,7 @@ export default {
} }
} }
</script> </script>
<% css.forEach(function (c) { %>
<style src="<%= (typeof c === 'string' ? c : c.src) %>" lang="<%= (c.lang ? c.lang : 'css') %>"></style>
<% }) %>

View File

@ -1,16 +0,0 @@
<template>
<div id="__nuxt">
<slot></slot>
</div>
</template>
<script>
export default {
name: 'nuxt-container',
head: <%= JSON.stringify(head) %>
}
</script>
<% css.forEach(function (c) { %>
<style src="<%= (typeof c === 'string' ? c : c.src) %>" lang="<%= (c.lang ? c.lang : 'css') %>"></style>
<% }) %>

View File

@ -4,14 +4,11 @@ import Vue from 'vue'
import Meta from 'vue-meta' import Meta from 'vue-meta'
import router from './router.js' import router from './router.js'
<% if (store) { %>import store from '~store/index.js'<% } %> <% if (store) { %>import store from '~store/index.js'<% } %>
import NuxtContainer from './components/nuxt-container.vue'
import NuxtChild from './components/nuxt-child.js' import NuxtChild from './components/nuxt-child.js'
import NuxtLink from './components/nuxt-link.js' import NuxtLink from './components/nuxt-link.js'
import Nuxt from './components/nuxt.vue' import Nuxt from './components/nuxt.vue'
import App from '<%= appPath %>' import App from '<%= appPath %>'
// Component: <nuxt-container>
Vue.component(NuxtContainer.name, NuxtContainer)
// Component: <nuxt-child> // Component: <nuxt-child>
Vue.component(NuxtChild.name, NuxtChild) Vue.component(NuxtChild.name, NuxtChild)
// Component: <nuxt-link> // Component: <nuxt-link>

View File

@ -154,7 +154,6 @@ function * generateRoutesAndFiles () {
'router.js', 'router.js',
'server.js', 'server.js',
'utils.js', 'utils.js',
'components/nuxt-container.vue',
'components/nuxt-loading.vue', 'components/nuxt-loading.vue',
'components/nuxt-child.js', 'components/nuxt-child.js',
'components/nuxt-link.js', 'components/nuxt-link.js',
@ -360,8 +359,10 @@ function createRenderer (bundle) {
function watchPages () { function watchPages () {
const patterns = [ const patterns = [
r(this.srcDir, 'pages'),
r(this.srcDir, 'pages/*.vue'), r(this.srcDir, 'pages/*.vue'),
r(this.srcDir, 'pages/**/*.vue'), r(this.srcDir, 'pages/**/*.vue'),
r(this.srcDir, 'layouts'),
r(this.srcDir, 'layouts/*.vue'), r(this.srcDir, 'layouts/*.vue'),
r(this.srcDir, 'layouts/**/*.vue') r(this.srcDir, 'layouts/**/*.vue')
] ]

View File

@ -1,5 +0,0 @@
<template>
<nuxt-container>
<nuxt/>
</nuxt-container>
</template>

View File

@ -0,0 +1,6 @@
<template>
<div>
<h1>Default layout</h1>
<nuxt/>
</div>
</template>