mirror of https://github.com/halo-dev/halo-admin
parent
982ba1f4f3
commit
a2abc9362d
@ -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";
|
@ -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