Currently using Vue.js version 2.6.10 and BootstrapVue version 2.0.0-rc.20. The goal is to dynamically display a dropdown menu upon clicking a separate button within a single file component.
<template lang='pug'>
div
b-button(@click='loginShow') Test
b-dropdown(id='login-dropdown', ref='dropdown', text='Login')
b-dropdown-item(to='/login') Login
b-dropdown-item(to='/signup') Sign up
</template>
<script lang="ts">
import { Component, Vue, Prop } from 'vue-property-decorator';
import { BDropdown } from 'bootstrap-vue';
@Component
export default class Login extends Vue {
private loginShow(e: any): void {
const dropdown = this.$refs.dropdown as BDropdown;
dropdown.visible = true;
}
}
</script>
Any thoughts on why this behavior is occurring?