【发布时间】:2021-12-23 14:05:37
【问题描述】:
当我单击Launch centered modal 时,我希望模态隐藏按钮x、cancel 和ok,因为showButton 是假的。
点击show button后,应该显示模态按钮,因为现在showButton为真。
我该怎么做?
App.vue
<template>
<div id="app">
<b-button v-b-modal.modal-center>Launch centered modal</b-button>
<b-modal id="modal-center" centered title="BootstrapVue">
<p class="my-4">Vertically centered modal!</p>
<button @click="setShowButton">Show Button</button>
</b-modal>
</div>
</template>
<script>
export default {
name: "App",
data() {
return {
showButton: false,
};
},
methods: {
setShowButton() {
this.showButton = true;
},
},
};
</script>
<style>
#app {
text-align: center;
color: #2c3e50;
margin-top: 60px;
}
</style>
代码沙盒
https://codesandbox.io/s/flamboyant-herschel-62wpt?file=/src/App.vue:0-587
【问题讨论】:
标签: javascript html css vue.js bootstrap-4