chore: add pug example (#4409)

[skip release]
This commit is contained in:
Alexander Lichter 2018-11-25 12:13:07 +00:00 committed by Pooya Parsa
parent 8666b53998
commit bf505eccd5
4 changed files with 45 additions and 0 deletions

3
examples/pug/README.md Normal file
View File

@ -0,0 +1,3 @@
# Nuxt.js with Pug
No further packages needed. It works out of the box.

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

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

18
examples/pug/pages/about.vue Executable file
View File

@ -0,0 +1,18 @@
<template lang="pug">
div
p Hi from {{ name }}
NuxtLink(to="/") Home Page
</template>
<script>
export default {
asyncData() {
return {
name: process.static ? 'static' : (process.server ? 'server' : 'client')
}
},
head: {
title: 'About page'
}
}
</script>

13
examples/pug/pages/index.vue Executable file
View File

@ -0,0 +1,13 @@
<template lang="pug">
div
h1 Welcome
NuxtLink(to="/about") About Page
</template>
<script>
export default {
head: {
title: 'Home page'
}
}
</script>