From a6ccc16adb427ec55171cc0e830d4285a805bd1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=A5=E6=B5=A9?= Date: Fri, 6 Dec 2024 15:05:16 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=9B=B4=E6=96=B0=20PSelect=20?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=EF=BC=8C=E6=94=AF=E6=8C=81=E5=BC=82=E6=AD=A5?= =?UTF-8?q?=E9=80=89=E9=A1=B9=E5=8A=A0=E8=BD=BD=E5=B9=B6=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=EF=BC=8C=E8=B0=83=E6=95=B4=E6=A0=B7=E5=BC=8F?= =?UTF-8?q?=E4=BB=A5=E6=94=B9=E5=96=84=E7=94=A8=E6=88=B7=E4=BD=93=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env | 3 ++- formkit.config.ts | 14 ++++++----- index.html | 3 +++ src/__fk-inputs__/inputs/p-select.tsx | 35 ++++++++++++++++++++------- src/all-custom/all-custom.vue | 30 ++++++++++++++--------- 5 files changed, 58 insertions(+), 27 deletions(-) diff --git a/.env b/.env index b2545d2..a7e00ae 100644 --- a/.env +++ b/.env @@ -1 +1,2 @@ -VITE_DEBUG_FORMKIT=true \ No newline at end of file +VITE_DEBUG_FORMKIT=true +# https://formkit.com/pro diff --git a/formkit.config.ts b/formkit.config.ts index 2d2b570..b43a3c9 100644 --- a/formkit.config.ts +++ b/formkit.config.ts @@ -14,9 +14,10 @@ import type { App } from 'vue'; import { addAsteriskPlugin } from './formkit.config.plugin.addAsteriskPlugin'; import { debugPlugin } from './formkit.config.plugin.debug'; import { PSelect } from '@/__fk-inputs__/inputs/p-select'; +import { createProPlugin, dropdown } from '@formkit/pro'; +import { rootClasses } from './formkit.config.theme'; const plugins: FormKitPlugin[] = [ - // createProPlugin(apiKey, { toggle }), // createLibraryPlugin(fkLibrary), createLibraryPlugin({ text, @@ -60,16 +61,17 @@ const plugins: FormKitPlugin[] = [ }, ), ]; -if (import.meta.env.VITE_DEBUG_FORMKIT === 'true') { - plugins.push(debugPlugin); -} -// const apiKey = 'fk-6cdd5192223' +if (import.meta.env.VITE_FORMKIT_PRO_KEY) + plugins.unshift(createProPlugin(import.meta.env.VITE_FORMKIT_PRO_KEY, { dropdown })); + +if (import.meta.env.VITE_DEBUG_FORMKIT === 'true') plugins.push(debugPlugin); + const config: FormKitOptions = { plugins, config: { // rootClasses: false, - // rootClasses, + rootClasses, // rootClasses: (sectionName: string, node: FormKitNode) => { // console.debug(`sectionName :>> `, sectionName); // } diff --git a/index.html b/index.html index 39efa31..3211b6d 100644 --- a/index.html +++ b/index.html @@ -33,6 +33,8 @@