question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Missing documentation for $bvModal.msgBox

See original GitHub issue

To my understanding, I can use $bvModal.msgBox to open a modal with any vue component on demand (eg with webpack code splitting) rather than mounting dozens of modals that aren’t even used most of the time.

I tried passing a component, but it doesn’t get rendered.

If this is the intended use, how would I pass data on modal creation, prevent closing if the input was invalid and get back the result after closing the modal if I passed a component containing a input field (as alternative to calling window.prompt())?

<script>
import HelloWorld from "./components/HelloWorld";

export default {
  data() {
    return {
      boxOne: ""
    };
  },
  methods: {
    showMsgBoxOne() {
      this.boxOne = "";
      this.$bvModal
        .msgBox(
          HelloWorld /* display this component as body */,
          {},
          event => event /* Somehow get component data */
        )
        .then(value => {
          this.boxOne = value;
        })
        .catch(err => {
          // An error occurred
        });
    }
  }
};
</script>

Edit Vue Template

image

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:13 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
tmorehousecommented, Jul 26, 2019

We are looking into adding more msgBox methods in the (somewhat) near future

0reactions
TuringJestcommented, Nov 12, 2020

As well, we are planning on adding “parameterized” modals where you can trigger a modal to open via this.$bvModad.show(modalID, { data }) which returns a promise which is resolved when the modal closes. the promise will return the results of the data object.

@tmorehouse That would be a really useful feature. Is there any process on this? I’m looking for a way to restrict button actions to logged in users. If not logged in, open a login modal, check the response, and return it, so that the button action can be finally called.

Is there anyway I can achieve this with the msgBoxConfirm by manually triggering the returned promise for ok/cancel (and hiding the default buttons)?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Bootstrap-vue bvModal msgBox - prevent closing on click
We can use the bootstrap-vue properties in the doc by converting it to lower camel case. Then you can prevent the modal from...
Read more >
Modal | Components - BootstrapVue
Modals will not render their content in the document until they are shown (lazily rendered). Modals, when visible, are rendered appended to the...
Read more >
bootstrap-vue - UNPKG
createElement('div')\n document.body.appendChild(div)\n msgBox.$mount(div)\n })\n }\n\n // BvModal instance class\n class BvModal {\n constructor(vm) {\n ...
Read more >
[Solved]-Accessing browser API through Vuejs-Vue.js
sweet alert CSS styles not being applied in Vue app · npm ERR! missing script: start Vue.js ... Bootstrap-vue bvModal msgBox - prevent...
Read more >
Error-- missing documentation (or could not parse ...
I am trying to import a custom python module. It is listing successfully in "ansible-doc --list" but shows documentation error. ERROR! module eip_solid_server ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found