关闭模态灰色背景后仍为VUEJS

时间:2020-11-12 08:17:44

标签: javascript node.js vue.js vue-component bootstrap-modal

在我的组件文件中,我有一个模态,该模态在promise.all()处解析关闭模态
,模式关闭成功,但是这里的gry背景仍然是我的代码:

<template>
<div class="modal modal-blur fade" id="modal-new" tabindex="-1" role="dialog" aria-hidden="true" v-if="modalShow">
<div v-bind:class="{'modal-lg':modalLarge, 'modal-dialog':true}" role="document">
...

数据:

data() {
  return {  
    modalLarge: 'modal-xl',
    modalShow: true, 
  }
}

这是内部方法:

Promise.all(actions).then(() => {
   this.modalShow = false;
   console.log('all request are parsed');
});

1 个答案:

答案 0 :(得分:0)

为第二个分区添加v-if='modalShow'

<template>
<div class="modal modal-blur fade" id="modal-new" tabindex="-1" role="dialog" aria-hidden="true" v-if="modalShow">
<div v-if="modalShow"  v-bind:class="{'modal-lg':modalLarge, 'modal-dialog':true}" role="document">