vaderjs 1.9.6 → 1.9.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/main.js +3 -1
- package/package.json +1 -1
package/main.js
CHANGED
|
@@ -216,11 +216,13 @@ async function generateApp() {
|
|
|
216
216
|
r = r.replace(process.cwd().replace(/\\/g, '/') + '/app', '')
|
|
217
217
|
r = r.replace('.jsx', '.js').replace('.tsx', '.js')
|
|
218
218
|
fs.mkdirSync(path.join(process.cwd() + '/dist', path.dirname(r)), { recursive: true })
|
|
219
|
+
let params = routes.match(route).params || {}
|
|
220
|
+
// handle route params multiple and
|
|
219
221
|
fs.writeFileSync(process.cwd() + '/dist/' + path.dirname(r) + '/' + path.basename(r), `
|
|
220
222
|
let route = window.location.pathname.split('/').filter(v => v !== '')
|
|
221
223
|
let params = {
|
|
222
224
|
${Object.keys(routes.match(route).params || {}).length > 0 ? Object.keys(routes.match(route).params || {}).map(p => {
|
|
223
|
-
return `${p}: route[${Object.keys(routes.match(route).params).indexOf(p)
|
|
225
|
+
return `${p}: route[${Object.keys(routes.match(route).params || {}).indexOf(p)}]`
|
|
224
226
|
}).join(',') : ""}
|
|
225
227
|
}
|
|
226
228
|
\n${code}
|