Files
sweet-hut-ui/src/components/Password/PasswordQuery.vue
2025-10-08 22:06:39 +08:00

57 lines
1.3 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<template>
<div class="mobile-common-query card-item">
<div class="query-item">
<span>分类</span>
<el-segmented v-model="passwordStore.queryInfo.category"
:options="queryCategoryList"
@change="passwordStore.queryPasswordList()"/>
</div>
<div class="query-item">
<span>所属人</span>
<el-segmented v-model="passwordStore.queryInfo.owner"
:options="queryOrderList"
@change="passwordStore.queryPasswordList()"/>
</div>
</div>
</template>
<script setup lang="ts">
import { onMounted, ref } from 'vue'
import { usePasswordStore } from '@/store/password.ts'
import { ICategory } from '@/types'
const passwordStore = usePasswordStore()
const queryCategoryList = ref([] as ICategory[])
onMounted(async () => {
await passwordStore.queryPasswordCategory()
initCategoryList()
})
const queryOrderList = [
{
label: '哥哥',
value: '哥哥'
}, {
label: '宝宝',
value: '宝宝'
}
]
const initCategoryList = () => {
queryCategoryList.value = []
queryCategoryList.value.push({
label: '全部',
value: ''
})
passwordStore.categoryList.forEach((item) => {
queryCategoryList.value.push({
label: item,
value: item
})
})
}
</script>