Add spa example

This commit is contained in:
Sebastien Chopin 2017-08-18 15:44:43 +02:00
parent 6461bcc9cb
commit 888a9ecbf2
4 changed files with 53 additions and 0 deletions

View File

@ -0,0 +1,20 @@
module.exports = {
mode: 'spa',
loadingIndicator: {
/*
** See https://github.com/nuxt/nuxt.js/tree/dev/lib/app/views/loading for available loading indicators
** You can add a custom indicator by giving a path
** Default: 'circle'
*/
name: 'folding-cube',
/*
** You can give custom options given to the template
** See https://github.com/nuxt/nuxt.js/blob/dev/lib/app/views/loading/folding-cube.html
** Default:
** - color: '#3B8070'
** - background: 'white'
*/
color: '#222',
background: '#eee'
}
}

11
examples/spa/package.json Normal file
View File

@ -0,0 +1,11 @@
{
"name": "hello-nuxt",
"dependencies": {
"nuxt": "latest"
},
"scripts": {
"dev": "nuxt",
"build": "nuxt build",
"start": "nuxt"
}
}

View File

@ -0,0 +1,16 @@
<template>
<div>
<p>Hi from {{ name }}</p>
<nuxt-link to="/">Home page</nuxt-link>
</div>
</template>
<script>
export default {
asyncData ({ isStatic, isServer }) {
return {
name: isStatic ? 'static' : (isServer ? 'server' : 'client')
}
}
}
</script>

View File

@ -0,0 +1,6 @@
<template>
<div>
<h1>Welcome!</h1>
<nuxt-link to="/about">About page</nuxt-link>
</div>
</template>