feat: 移除 postcss-prefix-selector 依赖,更新样式以支持深色模式,优化 TutorialForm 和 ZodForm 组件
Some checks failed
/ surge (push) Failing after 11s
Some checks failed
/ surge (push) Failing after 11s
This commit is contained in:
@ -58,11 +58,6 @@ const SCHEMA: FormKitSchemaDefinition = [
|
||||
}
|
||||
];
|
||||
|
||||
function onChangeName() {
|
||||
const nameNode = getNode('nameNodeId')
|
||||
nameNode?.input('测试')
|
||||
}
|
||||
|
||||
import autoAnimate from "@formkit/auto-animate"
|
||||
onMounted(() => {
|
||||
// setTimeout(() => {
|
||||
@ -73,9 +68,9 @@ onMounted(() => {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="bg-white rounded-xl shadow-xl p-8 mx-auto my-16 max-w-[450px]">
|
||||
<div class="bg-white rounded-xl shadow-xl p-8 mx-auto my-16 max-w-[450px] dark:bg-gray-800 ">
|
||||
<h1
|
||||
class="font-bold text-2xl mb-4"
|
||||
class="font-bold text-2xl mb-4 color:gray-800 dark:text-white"
|
||||
data-foo="bar"
|
||||
>Tutorial Form</h1>
|
||||
<FormKit
|
||||
@ -116,7 +111,7 @@ onMounted(() => {
|
||||
:help="`现在 confirmName 的值是:${attributes?.confirmName}`"
|
||||
some-attr="some-attr-value"
|
||||
>
|
||||
<template #label="{ classes, attrs, label }">
|
||||
<template #label="{ classes, attrs, label, node: nameNode }">
|
||||
<!-- <pre
|
||||
class="font-mono text-sm p-4 bg-slate-100 mb-4">{{ JSON.stringify({ classes, attrs, label }, null, 2) }}</pre> -->
|
||||
<label
|
||||
@ -126,7 +121,7 @@ onMounted(() => {
|
||||
>{{ label }}<button
|
||||
class="ml-2 px-2 py-1 bg-blue-500 text-white rounded"
|
||||
type="button"
|
||||
@click="onChangeName"
|
||||
@click="nameNode?.input('测试')"
|
||||
>点击赋值</button>
|
||||
</label>
|
||||
</template>
|
||||
@ -156,7 +151,6 @@ onMounted(() => {
|
||||
<FormKit
|
||||
type="range"
|
||||
name="strength"
|
||||
id="strength"
|
||||
label="力量"
|
||||
value="5"
|
||||
validation="min:2|max:9"
|
||||
@ -207,7 +201,7 @@ onMounted(() => {
|
||||
class="mb-4"
|
||||
/>
|
||||
|
||||
<pre class="font-mono text-sm p-4 bg-slate-100 mb-4">{{ value }}</pre>
|
||||
<pre class="font-mono text-sm p-4 bg-slate-100 mb-4 dark:bg-gray-800 ">{{ value }}</pre>
|
||||
|
||||
</FormKit>
|
||||
</div>
|
||||
@ -229,12 +223,4 @@ ul.error-box p {
|
||||
}
|
||||
</style>
|
||||
|
||||
<style>
|
||||
.attributes-group {
|
||||
padding: 1.5rem;
|
||||
border: 1px solid #e5e7eb;
|
||||
border-radius: 0.5rem;
|
||||
margin-bottom: 1rem;
|
||||
background-color: #f9fafb;
|
||||
}
|
||||
</style>
|
||||
<style></style>
|
Reference in New Issue
Block a user