# [Vue.js] Close bootstrap-vue modal with typescript Subscribe to RSS

there is a bootstrap-vue.js modal and try to close it in my click-function.

this.$refs[‘my-modal’].hide() but get the following error: Property ‘hide’ does not exist on type ‘vue.js | Element | Vue[] | Element[]‘. Property ‘hide’ does not exist on type ‘Vue’ I tried with jquery also$(‘#my-modal’).modal(‘hide’);

With error:

Property ‘modal’ does not exist on type ‘JQuery<HTMLElement>’

### Solution :

With the latest version of Bootstrapvue.js (2.0.0-rc.21 +), you can use the newer this.$bvModal.hide(id) method to close a modal with the specified id.$bvModal is typed, so it should work fine with Typescript.

### Solution 2:

When refs are not working for me in Vue+Typescript, I sometimes cast the ref to an HTMLElement or disable type checking by using any.

(this.$refs[‘my-modal’] as HTMLElement).hide() (this.$refs[‘my-modal’] as any).hide()