【发布时间】:2019-10-27 20:57:32
【问题描述】:
我有一个 bootstrap-vue 模式,并尝试在我的点击功能中关闭它。
this.$refs['my-modal'].hide()
但得到以下错误:
Property 'hide' does not exist on type 'Vue | Element | Vue[] | Element[]'.
Property 'hide' does not exist on type 'Vue'
我也试过 jquery
$('#my-modal').modal('hide');
有错误:
Property 'modal' does not exist on type 'JQuery<HTMLElement>'
【问题讨论】:
-
你试过 bootstrap-vue api 吗? bootstrap-vue.js.org/docs/components/modal/…
-
第一部分是您发送的链接的精确副本。似乎打字不起作用,我不知道如何让它们在打字稿中工作。
-
Bootstrap-Vue 不使用 jQuery,所以 jQuery 方法不起作用。
标签: typescript vue.js bootstrap-vue