diff --git a/examples/custom-routes/nuxt.config.js b/examples/custom-routes/nuxt.config.js index 5a1789baab..9c8e08af7a 100644 --- a/examples/custom-routes/nuxt.config.js +++ b/examples/custom-routes/nuxt.config.js @@ -1,7 +1,29 @@ +const axios = require('axios') + module.exports = { + env: { + token: 'Hello :)', + num: 3, + bool: true + }, router: { routes: [ - { name: 'user', path: '/users/:id', component: 'pages/_user' } + { name: 'user', path: '/users/:id(\\d+)', component: 'pages/_user' } ] + }, + build: { + vendor: ['axios'] + }, + generate: { + routeParams: { + '/users/:id(\\d+)': function () { + return axios.get('http://jsonplaceholder.typicode.com/users') + .then((res) => { + return res.data.map((user) => { + return { id: user.id } + }) + }) + } + } } } diff --git a/examples/hello-world/package.json b/examples/hello-world/package.json index 33d3b0501f..90075b7add 100644 --- a/examples/hello-world/package.json +++ b/examples/hello-world/package.json @@ -1,11 +1,9 @@ { - "name": "nuxt-hello-world", + "name": "hello-nuxt", "dependencies": { "nuxt": "latest" }, "scripts": { - "dev": "nuxt", - "build": "nuxt build", - "start": "nuxt start" + "dev": "nuxt" } } diff --git a/examples/hello-world/pages/about.vue b/examples/hello-world/pages/about.vue index 9f27ecf056..ed0dc56341 100755 --- a/examples/hello-world/pages/about.vue +++ b/examples/hello-world/pages/about.vue @@ -1,10 +1,5 @@ - - diff --git a/examples/hello-world/pages/index.vue b/examples/hello-world/pages/index.vue index 95aaf9fced..0f54495bd6 100755 --- a/examples/hello-world/pages/index.vue +++ b/examples/hello-world/pages/index.vue @@ -1,15 +1,6 @@ - - diff --git a/examples/static-images/package.json b/examples/static-images/package.json new file mode 100644 index 0000000000..33d3b0501f --- /dev/null +++ b/examples/static-images/package.json @@ -0,0 +1,11 @@ +{ + "name": "nuxt-hello-world", + "dependencies": { + "nuxt": "latest" + }, + "scripts": { + "dev": "nuxt", + "build": "nuxt build", + "start": "nuxt start" + } +} diff --git a/examples/static-images/pages/about.vue b/examples/static-images/pages/about.vue new file mode 100644 index 0000000000..9f27ecf056 --- /dev/null +++ b/examples/static-images/pages/about.vue @@ -0,0 +1,36 @@ + + + + + diff --git a/examples/static-images/pages/index.vue b/examples/static-images/pages/index.vue new file mode 100644 index 0000000000..95aaf9fced --- /dev/null +++ b/examples/static-images/pages/index.vue @@ -0,0 +1,15 @@ + + + diff --git a/examples/hello-world/static/nuxt-black.png b/examples/static-images/static/nuxt-black.png similarity index 100% rename from examples/hello-world/static/nuxt-black.png rename to examples/static-images/static/nuxt-black.png diff --git a/examples/hello-world/static/nuxt.png b/examples/static-images/static/nuxt.png similarity index 100% rename from examples/hello-world/static/nuxt.png rename to examples/static-images/static/nuxt.png