Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/vue.js/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Vue.js Vue Bootsrap toast在瞬间隐藏_Vue.js_Bootstrap Vue - Fatal编程技术网

Vue.js Vue Bootsrap toast在瞬间隐藏

Vue.js Vue Bootsrap toast在瞬间隐藏,vue.js,bootstrap-vue,Vue.js,Bootstrap Vue,在单击save按钮并将数据发送到API之后,我想添加一条toast消息。 我在下面的代码中添加了一条吐司消息,它出现在屏幕上,但转眼间就隐藏了 我应该再加一点吗?或者有另一种方法在动作后使用消息,可能使用警报而不是祝酒 谢谢你的回答 axiosInstance .put(`{{here is my endpoint}}`, payload) .then((response) => { console.log(response); let notifi

在单击save按钮并将数据发送到API之后,我想添加一条toast消息。 我在下面的代码中添加了一条吐司消息,它出现在屏幕上,但转眼间就隐藏了

我应该再加一点吗?或者有另一种方法在动作后使用消息,可能使用警报而不是祝酒

谢谢你的回答

axiosInstance
    .put(`{{here is my endpoint}}`, payload)
    .then((response) => {
      console.log(response);
      let notificationToast = (vm, append = false) => {
        vm.$bvToast.toast(`This is toast`, {
          title: "BootstrapVue Toast",
          autoHideDelay: 5000,
          appendToast: append,
          noAutoHide: true
        });
      };
      notificationToast(this, true);
    });

请创建一个我在小提琴中重现您的问题:。您是将
bootstrap vue
CDN
链接一起使用还是“使用模块绑定器”?@ImanShafiei它在您的小提琴中不起作用的原因是因为您包含了bootstrap 5,而不是bootstrap 4。也许OP也有同样的问题。这里的小提琴使用引导4。是的,事实上可能是这样,我有Bootstrap 5。。。需要切换回4并测试有趣的巧合,谢谢@Hiws,我认为问题现在可以解决了。