mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-23 14:15:13 +00:00
Add spa example
This commit is contained in:
parent
6461bcc9cb
commit
888a9ecbf2
20
examples/spa/nuxt.config.js
Normal file
20
examples/spa/nuxt.config.js
Normal 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
11
examples/spa/package.json
Normal file
@ -0,0 +1,11 @@
|
||||
{
|
||||
"name": "hello-nuxt",
|
||||
"dependencies": {
|
||||
"nuxt": "latest"
|
||||
},
|
||||
"scripts": {
|
||||
"dev": "nuxt",
|
||||
"build": "nuxt build",
|
||||
"start": "nuxt"
|
||||
}
|
||||
}
|
16
examples/spa/pages/about.vue
Normal file
16
examples/spa/pages/about.vue
Normal 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>
|
6
examples/spa/pages/index.vue
Normal file
6
examples/spa/pages/index.vue
Normal file
@ -0,0 +1,6 @@
|
||||
<template>
|
||||
<div>
|
||||
<h1>Welcome!</h1>
|
||||
<nuxt-link to="/about">About page</nuxt-link>
|
||||
</div>
|
||||
</template>
|
Loading…
Reference in New Issue
Block a user