-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: sidebar collapse btn & input clear btn
- Loading branch information
Showing
5 changed files
with
54 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<template> | ||
<div class="relative w-full flex-1"> | ||
<input | ||
v-model="inputValue" | ||
type="text" | ||
class="input input-sm join-item input-bordered w-full" | ||
/> | ||
<XMarkIcon | ||
class="absolute right-2 top-1/2 h-3 w-3 -translate-y-1/2 cursor-pointer" | ||
@click="clearInput" | ||
/> | ||
</div> | ||
</template> | ||
|
||
<script lang="ts" setup> | ||
import { XMarkIcon } from '@heroicons/vue/24/outline' | ||
import { defineProps, ref, watch } from 'vue' | ||
const props = defineProps({ | ||
label: { | ||
type: String, | ||
required: false, | ||
}, | ||
modelValue: { | ||
type: String, | ||
required: true, | ||
}, | ||
}) | ||
const inputValue = ref(props.modelValue) | ||
const emit = defineEmits(['update:modelValue']) | ||
watch(inputValue, (newValue) => { | ||
emit('update:modelValue', newValue) | ||
}) | ||
const clearInput = () => { | ||
inputValue.value = '' | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters