I'm new to Vue and i want to render a component after a user clicks on a button. Maybe I'm doing it incorrectly?
The <sample-component> is just a banner that's meant to appear at the top of the page
Sample Code
<template>
<div class="page">
<div class="content">
<sample-button @click="showBanner">
Show banner
</simplex-button>
</div>
</div>
</template>
<script lang="ts">
import Vue from 'vue';
export default Vue.extend({
methods: {
showBanner() {
return `
<template id="banner">
<div class="banner-page">
<sample-component>
<p> hello </p>
</sample-component>
</div>
</template>`;
},
},
});
</script>