mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-11 08:33:53 +00:00
Example with JSX
This commit is contained in:
parent
40ddfaacd7
commit
bea7b73ad5
11
examples/hello-world-jsx/package.json
Normal file
11
examples/hello-world-jsx/package.json
Normal file
@ -0,0 +1,11 @@
|
||||
{
|
||||
"name": "hello-nuxt-jsx",
|
||||
"dependencies": {
|
||||
"nuxt": "latest"
|
||||
},
|
||||
"scripts": {
|
||||
"dev": "nuxt",
|
||||
"build": "nuxt build",
|
||||
"start": "nuxt"
|
||||
}
|
||||
}
|
15
examples/hello-world-jsx/pages/about.vue
Normal file
15
examples/hello-world-jsx/pages/about.vue
Normal file
@ -0,0 +1,15 @@
|
||||
<script>
|
||||
export default {
|
||||
data ({ req }) {
|
||||
return {
|
||||
name: req ? 'server' : 'client'
|
||||
}
|
||||
},
|
||||
render (h) {
|
||||
return <div>
|
||||
<p>Hi from {this.name}</p>
|
||||
<nuxt-link to="/">Home page</nuxt-link>
|
||||
</div>
|
||||
}
|
||||
}
|
||||
</script>
|
10
examples/hello-world-jsx/pages/index.vue
Normal file
10
examples/hello-world-jsx/pages/index.vue
Normal file
@ -0,0 +1,10 @@
|
||||
<script>
|
||||
export default {
|
||||
render (h) {
|
||||
return <div>
|
||||
<h1>Welcome!</h1>
|
||||
<nuxt-link to="/about">About page</nuxt-link>
|
||||
</div>
|
||||
}
|
||||
}
|
||||
</script>
|
Loading…
Reference in New Issue
Block a user