I'm starting to work with vuejs. I have downloaded a template to start the development of a system; everything was right until I wanted to use a modal. It is in a component called baseLayout.vue and I tried to use it in a method in another component. Is it possible that I can manipulate it from another component? I want to open it, update the body with other elements. A fragment of my code is given below:
baseLayout.vue
<template>
<b-modal id="modal1" ref="modal1" title="Bootstrap-Vue">
<p class="my-4">Hello from modal!</p>
</b-modal></template>
I tried to use it from here Analytics.vue
<template>
<button class="btn-pill btn-shadow btn-wide fsize-1 btn btn-danger btn-lg" v-on:click="showModal()">ShowModal</button></template>
In the scripts:
methods: {
showModal(){
this.$refs.modal1.show()
}
}
I can not find a way to manipulate the modal that is in the component. And I have to use it from there because if I put it in the current component, it is superimposed by the header and other elements.
$rootas described here