From 298aab240510c0b93e1a67b6cf822efedb0f6168 Mon Sep 17 00:00:00 2001 From: Will Sheldon <114631109+wssheldon@users.noreply.github.com> Date: Wed, 20 Dec 2023 15:31:13 -0800 Subject: [PATCH] load plugin --- src/dispatch/static/dispatch/src/main.js | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/src/dispatch/static/dispatch/src/main.js b/src/dispatch/static/dispatch/src/main.js index 2fed60e30349..2d45aabd08b3 100644 --- a/src/dispatch/static/dispatch/src/main.js +++ b/src/dispatch/static/dispatch/src/main.js @@ -4,6 +4,7 @@ import { vuetifyPlugin } from "./vuetify/" import router from "./router/" import store from "./store" import { plugin, defaultConfig } from "@formkit/vue" +import { createProPlugin, autocomplete } from "@formkit/pro" import "roboto-fontface/css/roboto/roboto-fontface.css" import "font-awesome/css/font-awesome.css" @@ -22,13 +23,18 @@ let FORMKIT_ENTERPRISE_TOKEN = import.meta.env.FORMKIT_ENTERPRISE_TOKEN let isUsingFormkitEnterprise = false if (FORMKIT_ENTERPRISE_TOKEN) { - import("@formkit-enterprise/pro") - .then(() => { - isUsingFormkitEnterprise = true - }) - .catch((error) => { - console.error("Error loading @formkit-enterprise/pro", error) + const pro = createProPlugin(FORMKIT_ENTERPRISE_TOKEN, { + autocomplete, + }) + app.use( + plugin, + defaultConfig({ + plugins: [pro], }) + ) + isUsingFormkitEnterprise = true +} else { + app.use(plugin, defaultConfig) } if (SENTRY_ENABLED) { @@ -47,7 +53,6 @@ if (SENTRY_ENABLED) { } // Configure plugins -app.use(plugin, defaultConfig) app.use(vuetifyPlugin) app.use(router) app.use(store)