sl-express/project-wl-siji-uniapp-vue3/components/SearchInput/index.vue
shuhongfan cf5ac25c14 init
2023-09-04 16:40:17 +08:00

49 lines
982 B
Vue

<template>
<!-- 公用搜索框 -->
<view class="search">
<uni-icons class="searchIcon" @click="searchHandle()" type="search"></uni-icons>
<input v-model="searchKey" class="searchInput" @confirm="searchHandle()" focus placeholder="请输入运单号" />
</view>
<!-- end -->
</template>
<script setup>
import { ref } from 'vue';
const props = defineProps({
itemData: {
inputKey: String,
default: 'value'
}
});
const searchKey = ref('');
const emit = defineEmits(['searchHandle'])
const searchHandle = () => {
emit('searchHandle', searchKey.value)
}
</script>
<style lang="scss" scoped>
@import url(@/styles/theme.scss);
.search{
margin-bottom: 20rpx;
position: relative;
.searchIcon{
position: absolute;
left: 20rpx;
top: 18rpx;
}
.searchInput{
background-color: var(--neutral-color-cancel);
border-radius: 32rpx;
font-size: var(--font-size-12);
line-height: 64rpx;
height: 64rpx;
padding: 0 20rpx 0 60rpx;
}
}
</style>