1👍
There are 2 issues:
1) There’s an error:
Cannot use
<template>
as component root element because it may contain multiple nodes.
So change that to a div
. When using the Vue CLI, templates are wrapped in <template>
but there still needs to be a different root element inside of it.
2) The Level
component has a prop called message
but it isn’t passed. The Home
route passes id
but not message
. Home
can’t pass message
at the moment, because it’s in the root component, and Home
didn’t receive it.
You could:
- Use Vuex to solve this most cleanly
- Define
message
inHome
instead of the root and pass it toLevel
- Pass the
message
from root toHome
and then again fromHome
toLevel
👤Dan
- [Vuejs]-Call method when modal closes in Vue
- [Vuejs]-Typescript giving me errors with variables, and is also compiling code that javascript does not know about
Source:stackexchange.com