I'm trying to pass a simple prop to another component in Vue 3.0.11, but I can't seem to get it to work. Here's my App component:
<template>
<Loading :message="Importing"></Loading>
</template>
<script>
import Loading from "./components/Loading.vue";
export default {
name: "App",
components: { Loading },
};
</script>
<style>
</style>
And my Loading
component:
<template>
<div>{{ loadingText }}...</div>
</template>
<script>
export default {
name: "Loading",
props: ["message"],
data() {
return {
loadingText: this.message || "Loading",
};
},
};
</script>
<style scoped>
</style>
I'm trying to pass the prop message
with the value Importing
, but in the Loading component it's telling me the message
prop is undefined. Here's a REPREX: https://codesandbox.io/s/vibrant-raman-pweb4
What am I doing wrong?