mirror of
https://github.com/speatzle/nfsense.git
synced 2025-05-11 19:08:20 +00:00
vee-validate experiments
This commit is contained in:
parent
232670f161
commit
b319e9573d
2 changed files with 35 additions and 2 deletions
|
@ -5,6 +5,13 @@ import './global-styles/mlfe.css';
|
||||||
import './global-styles/transitions.css';
|
import './global-styles/transitions.css';
|
||||||
import 'vue-toast-notification/dist/theme-default.css';
|
import 'vue-toast-notification/dist/theme-default.css';
|
||||||
|
|
||||||
|
import PillBar from "./components/inputs/PillBar.vue";
|
||||||
|
import TextBox from "./components/inputs/TextBox.vue";
|
||||||
|
import MultilineTextBox from "./components/inputs/MultilineTextBox.vue";
|
||||||
|
import CheckBox from "./components/inputs/CheckBox.vue";
|
||||||
|
|
||||||
|
import { Form, Field, ErrorMessage } from 'vee-validate';
|
||||||
|
|
||||||
import App from './App.vue';
|
import App from './App.vue';
|
||||||
import { createHead } from '@vueuse/head';
|
import { createHead } from '@vueuse/head';
|
||||||
import { createRouter, createWebHistory } from 'vue-router';
|
import { createRouter, createWebHistory } from 'vue-router';
|
||||||
|
@ -22,4 +29,13 @@ app.use(router);
|
||||||
app.use(head);
|
app.use(head);
|
||||||
app.use(ToastPlugin);
|
app.use(ToastPlugin);
|
||||||
|
|
||||||
|
// Global Components
|
||||||
|
app.component('PillBar', PillBar)
|
||||||
|
app.component('TextBox', TextBox)
|
||||||
|
app.component('MultilineTextBox', MultilineTextBox)
|
||||||
|
app.component('CheckBox', CheckBox)
|
||||||
|
app.component('ValidationForm', Form)
|
||||||
|
app.component('Field', Field)
|
||||||
|
app.component('ErrorMessage', ErrorMessage)
|
||||||
|
|
||||||
app.mount('#app');
|
app.mount('#app');
|
||||||
|
|
|
@ -4,6 +4,7 @@ import PillBar from "../components/inputs/PillBar.vue";
|
||||||
import TextBox from "../components/inputs/TextBox.vue";
|
import TextBox from "../components/inputs/TextBox.vue";
|
||||||
import MultilineTextBox from "../components/inputs/MultilineTextBox.vue";
|
import MultilineTextBox from "../components/inputs/MultilineTextBox.vue";
|
||||||
import CheckBox from "../components/inputs/CheckBox.vue";
|
import CheckBox from "../components/inputs/CheckBox.vue";
|
||||||
|
import { Form as ValidationForm, Field, ErrorMessage } from 'vee-validate';
|
||||||
|
|
||||||
async function doShit(){
|
async function doShit(){
|
||||||
apiCall("Firewall.GetForwardRules", {});
|
apiCall("Firewall.GetForwardRules", {});
|
||||||
|
@ -23,10 +24,26 @@ let fields = $ref([
|
||||||
<PageHeader title="Dashboard">
|
<PageHeader title="Dashboard">
|
||||||
<button @click="doShit">Example Buttons</button>
|
<button @click="doShit">Example Buttons</button>
|
||||||
</PageHeader>
|
</PageHeader>
|
||||||
<NiceForm class="scroll cl-secondary" title="Testasdfdsfsdf" :fields="fields"/>
|
<ValidationForm class="form">
|
||||||
|
<Field name="email" as="TextBox" />
|
||||||
|
<ErrorMessage name="email" />
|
||||||
|
<Field name="email" as="MultilineTextBox" />
|
||||||
|
<ErrorMessage name="email" />
|
||||||
|
</ValidationForm>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
.form {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: auto 1fr;
|
||||||
|
padding: 0.5rem;
|
||||||
|
gap: 0.5rem;
|
||||||
|
}
|
||||||
|
.form > :is(button, .button, h2) {
|
||||||
|
grid-column: 1 / 3;
|
||||||
|
}
|
||||||
|
.form > :is(label) {
|
||||||
|
grid-column: 1;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
Loading…
Add table
Reference in a new issue