Vuejs:渲染后回调 [英] Vuejs: Callback after render

查看:311
本文介绍了Vuejs:渲染后回调的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Bootstrap弹出窗口,我想将其附加到具有条件渲染的元素上;因此,必须在将元素附加到DOM之后触发$()。popover()。

I have a Bootstrap popover that I want to attach to an element that has a conditional render; therefore, I must trigger $().popover() after the element has been attached to the DOM.

是否可以触发回调 之后 ,是否有v-if语句将元素插入DOM?

Is there a way to trigger a callback after a v-if statement inserts the elements into the DOM?

推荐答案

在vuejs 2中使用它:

Use this in vuejs 2:

updated: function() {
    $('[data-toggle="tooltip"]').tooltip();
},

看看此处

这篇关于Vuejs:渲染后回调的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆