如何在Vue-Bootstrap Popover上使用clickaway?

时间:2019-02-20 20:45:31

标签: javascript twitter-bootstrap vue.js

我正在尝试找到一种禁用Popover的方法。但是,当弹出框被激活时,它不会保留与源代码中相同的标记,因此我无法在标记上使用vue-clickaway mixin。

TS

import { mixin as clickaway } from 'vue-clickaway'

@Template
@Component({
  components: {
    'b-popover': bPopover
  },
  mixins: [clickaway]
})

HTML

<b-popover target="content-more-button"
  v-if="showMoreButton"
  :show.sync="showPopover"
  v-on-clickaway="hidePopover"
  placement="bottom"
  html="true">
  <div class='popover'>{{content}}</div>
</b-popover>

但是,如果将mixin放在此处,则毫无作用。那么,有谁知道我如何实现Popover的clickedaway并在发生这种情况时执行功能?不需要使用vue-clickaway。任何解决方案都足够。

我的尝试没有运气,也没有在网上找到有关此问题的任何信息。

0 个答案:

没有答案