mirror of https://github.com/halo-dev/halo
parent
d9293f2199
commit
6b9d05112c
|
@ -0,0 +1,17 @@
|
|||
<script lang="ts" setup>
|
||||
defineProps({
|
||||
modelValue: {
|
||||
type: String,
|
||||
},
|
||||
});
|
||||
|
||||
const emit = defineEmits(["update:modelValue"]);
|
||||
|
||||
function handleInput(e: Event) {
|
||||
const { value } = e.target as HTMLInputElement;
|
||||
emit("update:modelValue", value);
|
||||
}
|
||||
</script>
|
||||
<template>
|
||||
<input type="text" :value="modelValue" @input="handleInput" />
|
||||
</template>
|
|
@ -0,0 +1,8 @@
|
|||
import { describe, expect, it } from "vitest";
|
||||
import { VInput } from "../index";
|
||||
|
||||
describe("Input", () => {
|
||||
it("should render", () => {
|
||||
expect(VInput).toBeDefined();
|
||||
});
|
||||
});
|
|
@ -0,0 +1 @@
|
|||
export { default as VInput } from "./Input.vue";
|
|
@ -4,7 +4,7 @@ export const routes: Array<RouteRecordRaw> = [
|
|||
{
|
||||
path: "/",
|
||||
name: "Dashboard",
|
||||
component: () => import("../views/AboutView.vue"),
|
||||
component: () => import("../views/HomeView.vue"),
|
||||
},
|
||||
{
|
||||
path: "/about",
|
||||
|
|
|
@ -1,3 +1,10 @@
|
|||
<template>
|
||||
<main class="text-red-600">Hello Halo!</main>
|
||||
<VInput v-model="value" />
|
||||
{{ value }}
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { VInput } from "@/components/base/input";
|
||||
import { ref } from "vue";
|
||||
const value = ref();
|
||||
</script>
|
||||
|
|
Loading…
Reference in New Issue