P粉0601123962023-08-26 23:14:24
The template string only uses backticks, but your string uses both single quotes and backticks.
replacement value (route.params.id
) refers to a route
variable that appears to be undefined in your example. I think you want to access this.$route
, so the actual replacement should be this.$route.params.id
items
The array should look like this:
export default { data() { return { items: [ { title: 'List User', url: `/user/function/listUser/${this.$route.params.id}` }, { title: 'structure User', url: `/user/function/structUser/${this.$route.params.id}` } ] } } }
P粉2933419692023-08-26 09:53:54
This is an example
`/user/function/structUser/${this.$route.params.id}`
Also, maybe try using it inside a computed
as it may not be a computed property.