vue-route-generator icon indicating copy to clipboard operation
vue-route-generator copied to clipboard

Allow scripted <route-meta/>

Open ferk6a opened this issue 5 years ago • 4 comments

Currently, <route-meta> is JSON, but it would be nice if it could script it so it runs once:

<route-meta>
import { title } from "./route-meta";

export default {
  title,
  tabTitle: "My Custom Tab",
}
</route-meta>
export const title = "My title";

ferk6a avatar Feb 23 '20 14:02 ferk6a

Sounds good to me. Although the implementation will be much more complicated as we need to analyse JS code and resolve each import statement.

ktsn avatar Feb 23 '20 14:02 ktsn

It would also be nice to have support for redirect in the route meta or a way to define redirect for page routes

nonsocode avatar Jul 19 '20 08:07 nonsocode

Hey @nonsocode,

Redirect already works in the route meta from my testing...

<route>
{
  "name": "home",
  "redirect": "/campaigns"
}
</route>

gilesbutler avatar Sep 20 '20 01:09 gilesbutler

@ktsn I need this too... I think we can just use webpack to do the hard work, are you ok for receiving a PR for this?

yaquawa avatar May 12 '21 14:05 yaquawa