Unable to view Vue.js bulma modal pop-up

When a link is clicked, I want to trigger the opening of a modal:

 <a @click="showEditModalFunc()" href="#">Edit Post</a>

The function itself:

  showEditModalFunc() {
    console.log('showEditModal value is' , this.showEditModal);
     this.showEditModal=!this.showEditModal;
  },

This is the markup for the modal:

<div v-if="showEditModal" class="modal">
  <div class="modal-background"></div>
  <div class="modal-content">
    <!-- Any other Bulma elements you want -->
    Lorem, ipsum dolor sit amet  
  </div>
  <button class="modal-close is-large" aria-label="close"></button>
</div>

Although it seems simple, the modal doesn't appear when expected!

No errors are reported and the console shows showEditModal value is true.

The modal design relies on bulma.css. Interestingly, another modal within the same component that was created with bootstrap.css works perfectly.

I'm puzzled by what could be causing this issue. Any suggestions on how to troubleshoot and resolve it?

Answer №1

As per the guidelines in bulma.css documentation:

In order to trigger the modal, simply include the is-active modifier on the .modal container

Therefore, a class binding can be utilized like this:

<div v-bind:class="{ 'is-active': showModal }' class="modal">
  <div class="modal-background"></div>
  <div class="modal-content">
    <!-- Include any other Bulma components as needed -->
    Lorem ipsum dolor sit amet  
  </div>
  <button class="modal-close is-large" aria-label="close"></button>
</div>

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

The creation of numerous DOM elements in D3

I'm currently utilizing the Tableau JS API to develop animated charts with D3.js. Within a Canvas(DOM) element, I am generating the necessary charts using the getUnderlyingData() function. This function is triggered whenever there's a change in f ...

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? ...

Using Javascript to automate the organization of links based on predefined criteria is an

Picture This: A digital library full of categorized links, totaling 1000 in number. Diverse themes are covered by these links, making it a treasure trove of information. Displayed prominently at the top are buttons labeled ALL, MOBILE, CARS, BOOKS, and TE ...

Button click causing TextField to print incorrectly

I am working on implementing a feature in my react application where users can input a search term, and upon pressing the button, it will be used to perform a search. The text input field and button are utilizing material-ui components. At this stage, I si ...

Significant increase in response time observed after 3 minutes of inactivity on the Web API

I've encountered a peculiar issue in both my preproduction and production environments (but not in development). My website performs various operations on a Web Api that is hosted on the same IIS server. Typically, a specific POST request is process ...

Create a PDF on-the-fly by leveraging Vuejs to dynamically pull data and design elements

Is it possible to create a form that captures name, expiry date, and picture, and upon submission generates a PDF document with the provided details? The PDF should be based on a design created by me and have the input data displayed in a specific location ...

How can I dynamically update an input field within a Bootstrap modal only if the field is not already filled?

I am facing an issue with my dynamic table form. After filling out the form, I want the values from all fields to be inserted into one field with commas separating them. However, I am unsure of how to check if a field is empty and insert data, or update da ...

Determine the position of a relative element using jQuery and CSS, then adjust the position of the tooltip

I designed a map that displays different locations, and when you hover over each location, a tooltip appears next to the cursor with information about that specific spot. The map is used as a background image for the main ul element with an id of "map". E ...

Storing button HTML in a variable with the help of jQuery

Looking for a way to store dynamically created button content in a variable using jQuery. <button id="test">Update now</button> This could include text or image data between the button tags, like icon images and text. The storage process sho ...

Having difficulty replicating the sorting process in Vue.js for the second time

I need assistance with implementing sorting functionality in a Vue.js table component. Currently, the sorting mechanism is working fine on the first click of the th item, but it fails to sort the items on subsequent clicks. const columns = [{ name: &ap ...

Disable the second tab within an Angular md-tabs component

Are there any attributes in angular material md-tabs that can be used to disable a tab, similar to what is available in Bootstrap? $scope.tabs = [{ title: 'Dynamic Title 1', content: 'Dynamic content 1' }, { title: 'Dy ...

Creating separate UI-views using ui-router within a single module

Can two independent ui-views be created using ui-router for a single module? The objective is to have the ui-views "know" where to display the current state, essentially creating a form of redirection. https://i.sstatic.net/OTNNL.png ...

What is the best way to merge arrays based on their indexes in Javascript?

I am facing a challenge with two 2d arrays: var ar1 = []; var ar1[0] = []; var ar1[0][0] = 1; var ar1[0][1] = 2; var ar1[1] = []; var ar1[1][0] = 3; var ar1[1][1] = 4; var ar2 = []; var ar2[0] = []; var ar2[0][3] = 5; var ar2[0][4] = 6; var ar2[1] = []; ...

Top method for creating 12 dynamic product pages using AngularJS with customized routing and templates

As someone who is still relatively new to AngularJS, I am looking for advice on how to properly structure the products section of my application. My main product page will display all 12 products with clickable links to individual product pages. Each indi ...

Issues have been encountered with the functionality of $rootScope

I am currently struggling with a code snippet in my loginCtrl.js file where I can't seem to get $rootScope to store the value of vm.userEmail. app.controller('LoginCtrl', function($timeout, $q, $log, $rootScope /*$auth*/, $location, $mdTo ...

Change the visibility of a div element by leveraging the data-target attribute

Hey there, I have a question about how to use the data-target attribute to set the display of a div. Check out my HTML code below: <div class="page page-current" id="home"> PAGE 1 <a href="#" class="next" data-target="#about">Go to about< ...

The constructor window.CCapture is not valid in Node.js environment

Can anyone help me figure out how to load CCapture in Node.js without using a headless browser for recording canvas stream? Every time I try, I keep running into the error message saying "window.CCapture is not a constructor." If you are familiar with the ...

Providing an aggregate outcome from an array

There's a puzzle for you: data = [ '2016-12-12 pass [pass]', '2016-12-12 pass [pass]', '2016-12-12 fail [fail]', '2016-12-13 fail [fail]', '2016-12-14 fail [fail]', '2016-12-14 pass [pa ...

What is the reason for Nightwatch running each .js file as a Child process? Could it be due to alterations in the configuration settings

Recently, I've been experiencing an issue when running Nightwatch.js where my console is spawning child processes for every .js file in each folder and subfolder. Multiple Chrome instances are opening along with them and even the module folders with r ...

ClickAwayListener is preventing the onClick event from being fired within a component that is nested

I am encountering an issue with the clickAwayListener feature of material-ui. It seems to be disabling the onClick event in one of the buttons on a nested component. Upon removing the ClickAwayListener, everything functions as expected. However, with it e ...