"The hide method of Bootsrap-Vue Modal is invalid"
P粉428986744
P粉428986744 2023-08-25 17:59:43
0
2
510

I have a simple bootstrap-vue modal that contains an input text. I want the Ok button to not automatically close when I press it, so I use "prevent". Then I do some validation and then want to close it using the "hide" method. But doesn't work for me. The strange thing is that the show method works completely fine. I checked the documentation and can't find where the error is. How do I make the hide method work for me at that point? Here is my code.

   

我尝试的语法:

 this.$refs.grfSaveModal.hide(); this.$refs['grfSaveModal'].hide(); this.$bvModal.hide('grfSaveModal'); 
P粉428986744
P粉428986744

reply all (2)
P粉020556231

Edit: Did you use v-model? Pass data to v-model and update it if needed

You have another option.

 //在script标签中 this.$bvModal.hide('bv-modal-example')

Or you can use the v-model attribute to control the Bootstrap Vue modal box.

Please checkDocumentation.

    P粉344355715

    The problem is that you are trying to close it at the same moment while preventing it from closing.

    You can solve this problem by deferring the hidden method to the next moment usingthis.$nextTick.

    this.$nextTick(() => { this.$bvModal.hide('grfGuardarModal') })
      Latest Downloads
      More>
      Web Effects
      Website Source Code
      Website Materials
      Front End Template
      About us Disclaimer Sitemap
      php.cn:Public welfare online PHP training,Help PHP learners grow quickly!