Conceal the initial Modal in Vue Bootstrap upon opening the second modal

I have a button in my application that triggers a modal when clicked. The button code is as follows:

<b-button variant="success" v-b-modal.import-list-type>
    <feather-icon
        icon="DownloadCloudIcon"
        class="mr-50"
    />
    <span class="align-middle">Import</span>
</b-button>        

Upon clicking this button, a modal with the following code is displayed:

<b-modal
    id="import-list-type"
    cancel-variant="secondary"
    hide-footer
    centered
    size="lg"
    title="Select Import Type"
>
    <ProjectImportType/>
</b-modal>

The child component called <ProjectImportType/> is visible within this modal.

Within the child component, there is another button coded like this:

<b-button variant="primary" v-b-modal.import-xml-modal> Import XML </b-button>

Clicking this button triggers yet another modal to appear with the following code:

<b-modal
    id="import-xml-modal"
    cancel-variant="secondary"
    hide-footer
    centered
    size="xl"
    title="New Import"
    @shown="handleImportTypeModal"
>
    <template #modal-header="">
        <b-img
            :src="require('@/assets/images/projects/xml.png')"
            width="34"
            alt="New Import"
        />
        <h5 class="mr-auto ml-2 mt-2" vertical-align="bottom">New Import</h5>
    </template>
    <ProjectImportNew/>
</b-modal>

While the second modal is displayed, I would like to hide the first one. Can you please provide guidance on how I can achieve this?

Answer №1

To enhance user experience, you can include a v-if="showImportTypeModal" directive in the initial modal and ensure it is set to false upon clicking the secondary button. The property showImportTypeModal should be initialized as false and switched to true once the primary button is triggered.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Troubleshooting the Issue of PHP Variables Not Being Assigned to Javascript Variables

I am currently struggling with an issue. I am trying to assign a PHP value to a variable in Javascript. Here is what I have attempted: <script> JSvariable = <?php echo $PHPvariable; ?>; </script> However, this approach is not yieldi ...

Issues with 'Backspace' and 'Clear' buttons on HTML calculator preventing proper function in JavaScript

Hello everyone! I've recently started working on a pure HTML/CSS/JS calculator project. While the HTML and CSS parts went smoothly, I'm facing some issues with getting the initial functions to work properly. Despite doing some research online, I ...

DevExtreme by DevExpress: Enhancing Angular2 with advanced pre-selection features

Currently, I am integrating DevExpress' DevExtreme with Angular2. In my application, there is a data grid below that displays a list of states and prompts the user to select some of them. Some states may have already been saved in the database. How ca ...

Could you provide me with a demonstration of cross-domain functionality?

Similar Inquiry: Methods to bypass the same-origin policy Let's consider two domains for this example - "" and "". The first domain "" is generating data in JSON format as shown below: { "str_info": [ { "str_name": "Mark ...

Guide for deploying a Vue.js - Express app on a local Ubuntu machine

Can anyone provide guidance on deploying a full stack Vue-Express application to a local Ubuntu server? I've been searching online but haven't found clear instructions. Any help would be greatly appreciated. ...

An issue has been encountered in the following module federation: `TypeError: g.useSyncExternalStore is not a function`

I encountered an error after deploying my next app with module federation: TypeError: g.useSyncExternalStore is not a function The same app works fine as a standalone application when run with yarn dev or yarn start, but it fails when using module federat ...

Creating personalized tags or components by utilizing insertAdjacentHTML in Vue

With the use of insertAdjacentHTML, I am able to create HTML elements such as div and span, but it seems that I cannot generate custom tags like <myComponent> </myComponent>. I understand that insertAdjacentHTML can create HTML elements, but a ...

Problem with loading CSS and JavaScript files on Node.js server

Recently, I delved into learning Node.js and created a basic server setup like this: // workspace const p = document.querySelector('p'); p.textContent = 'aleluja'; html { font-size: 10px; } body { font-size: 2rem; } <!DOCTYPE ht ...

Struggling with updating scope values when binding data in Angular (particularly with a slider)

Currently, I am utilizing Angular to develop a tool that can take user input from a slider tool and dynamically update an "estimate" field whenever the values are adjusted. However, I'm encountering an issue where the data is only binding in one direc ...

Are there any drawbacks to utilizing data attributes for modifying content through JavaScript?

On my journey of developing a basic web app, I am faced with the challenge of updating data displayed on the screen based on certain events or conditions. The data is spread across various locations and embedded in completely different markup structures. I ...

Tips for adjusting the dimensions of material table within a react application

Could someone please provide guidance on adjusting the size of a table made with material table? I am currently working in React and the following code is not yielding the desired outcome. I even attempted to use 'react-virtualized-auto-sizer' wi ...

Using Node.js and the Jade templating engine, display the value of a passed variable

Asking such a basic question makes me feel guilty. app.get('/skumanagement/:id', function (req, res){ var options = req.params.id; // req.params.id = itemidx database.skuGetDetail(options, function (error, data){ winston.log('inf ...

When incorporating TinyMCE-editor dynamically into a textarea, it disrupts existing instances

My HTML page consists of text areas with TinyMCE-editors added to them using tinyMCE.init({mode : "textareas", etc...});. Initially, everything works smoothly. However, I have a button that dynamically adds a new textarea to the page via AJAX. Upon receivi ...

Attempting to develop a filtering feature using ReactJS

Having some trouble with the if statement in my filter list function. Can't seem to figure out why it's not working properly. Here is the code snippet: filterList (event) { var updatedList = this.props.array; var filterText = this.stat ...

"Troubleshooting: Select Box not refreshing with Ajax, PHP,

I have encountered an issue while trying to update the select box sub_cat_id_1 with database values after selecting cat_id_1. The problem that I am facing is that the box is blank instead of displaying the correct values. Upon investigating, I have confirm ...

What is the reason for my JSON reference returning as undefined?

Here's my JavaScript code: $.getJSON("/aTest.json", function (jsonObj) { $("#testJSONBtn").click(function () { var val = ""; for (var i = 0; i <= jsonObj.events.length; ++i) { val += jsonObj.events[i].title + ", " + ...

Enhancing user experience with autocomplete functionality using jQuery combined with server

Struggling with autocompleting a search field using jQuery-UI and encountering issues when trying to integrate PHP as the data source. The setup works smoothly with a variable as the source. JS: $(function () { var data = [ "ActionScript", ...

What is the best method for data storage in Vue.js - Vuex or local storage?

Consider this scenario: when working with user data (such as username and full name) in our components, what is the preferred storage location - Vuex or local storage? ...

The vue transition elements vanish while in the midst of the animation phase

While using Vue Transition during page navigation, I encountered a problem. Involving a table with components, when transitioning to a new page, some components from the table disappear, causing the table to re-render and blink mid-transition. It took me s ...

Issue with Angular: Undefined Controller Error When Implementing Directive

Encountering an issue when trying to incorporate a directive into my website: Error: [ng:areq] Argument 'MainController' is not a function, got undefined This problem arises specifically when I include the welcome-directive (welcome.js) in my s ...