Comments (3)
I would like to add to this that supplying the possible values for dynamic routes (without specifying the routes it applies to, just as lists of values or records) would be even better, something even Nuxt currently doesn't do. This would be particularly useful with the file API for routes.
from deprecated.
@qm3ster how would the potential API look like? I didn't really get what supplying the possible values for dynamic routes (without specifying the routes it applies to, just as lists of values or records)
means.
from deprecated.
It's just an idea.
By values
{
generate: {
routes: ['/', '/user/:name/', '/user/:name/:id/'],
data: { name: ['egoist', 'trump'], id: [1, 2] } // by values
}
}
// /
// /user/egoist/
// /user/egoist/1/
// /user/egoist/2/
// /user/trump/
// /user/trump/1/
// /user/trump/2/
By records
{
generate: {
routes: ['/', '/user/:name/:id/'],
data: [
{name: 'egoist', id: 1},
{name: 'trump', id: 1},
{name: 'trump', id: 2}
] // by records
}
}
// /
// /user/egoist/1/
// /user/trump/1/
// /user/trump/2/
Combined with Object routes
{
generate: {
routes: {
'/': true,
'/user/:name/:id': [
{ name: 'egoist' },
{ name: 'trump' }
]
}
data: {id: [1, 2] } // by values
}
}
// /
// /user/egoist/1/
// /user/egoist/2/
// /user/trump/1/
// /user/trump/2/
Combined with :static:
{
generate: {
routes: [':static:'], // from router options
data: { name: ['egoist', 'trump'] } // by values
}
}
from deprecated.
Related Issues (20)
- Default error message (You must create pages/*.vue) is misleading
- How to use i18n in my project HOT 5
- Critical: Ream creates invalid Webpack config object HOT 4
- getInitialData is lost when using Vue.extend HOT 4
- Client-side getInitialData redirect to absolute URL shows new component for a moment HOT 1
- Unexpected token initialDataKey HOT 3
- Client-side getInitialData redirect to relative URL doesn't work HOT 1
- with-apollo example is outdated HOT 1
- `ream dev` triple rebuild HOT 3
- Change enhanceApp context API HOT 4
- Vuex example not listing vuex in package.json HOT 5
- how to use postcss
- Disable SSR for some part of code HOT 1
- Ream fails to compile with newest Webpack due to missing uglifyjs HOT 2
- Exception in getInitialDate returns HTTP 200 HOT 1
- Prefetching data with `ssrPrefetch`
- is there any guide for deploy and build? HOT 3
- how to enable babel-polyfill in webpack?
- how to use mqtt in ream for browser?
- In latest webpack, cache is mistakenly reused between server and client builds HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from deprecated.