From ef626766ef5d3abde4b8698dca01e17ccbd8327a Mon Sep 17 00:00:00 2001 From: Dmitry Date: Sat, 5 Jun 2021 13:46:59 +0300 Subject: [PATCH] tooltip in try --- src/main.js | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/src/main.js b/src/main.js index e10c10c..778f181 100644 --- a/src/main.js +++ b/src/main.js @@ -11,18 +11,32 @@ window.jQuery = window.$ = require("jquery"); const app = createApp(App).use(store).use(router); +const pass = () => {}; + app.directive("tooltip", { mounted(el, binding) { - window.$(el).tooltip({ - placement: binding.arg, - trigger: "hover", - }); + try { + window.$(el).tooltip({ + placement: binding.arg, + trigger: "hover", + }); + } catch { + pass(); + } }, updated(el) { - window.$(el).tooltip("update"); + try { + window.$(el).tooltip("update"); + } catch { + pass(); + } }, unmounted(el) { - window.$(el).tooltip("dispose"); + try { + window.$(el).tooltip("dispose"); + } catch { + pass(); + } }, });