27 lines
670 B
Vue
27 lines
670 B
Vue
|
|
<template>
|
||
|
|
<div class="sidebar-view">
|
||
|
|
<ProjectSelector :selectedProjectId="selectedProjectId" @project-selected="handleProjectSelected" />
|
||
|
|
</div>
|
||
|
|
</template>
|
||
|
|
|
||
|
|
<script setup>
|
||
|
|
import { ref } from 'vue';
|
||
|
|
import ProjectSelector from '../components/ProjectSelector.vue';
|
||
|
|
|
||
|
|
// 选中的项目ID
|
||
|
|
const selectedProjectId = ref('all');
|
||
|
|
|
||
|
|
// 项目选择事件
|
||
|
|
const handleProjectSelected = (project) => {
|
||
|
|
selectedProjectId.value = project.id;
|
||
|
|
console.log('选中项目:', project);
|
||
|
|
// 这里可以通过事件总线或状态管理工具将选中的项目传递给其他组件
|
||
|
|
};
|
||
|
|
</script>
|
||
|
|
|
||
|
|
<style scoped>
|
||
|
|
.sidebar-view {
|
||
|
|
height: 100%;
|
||
|
|
overflow-y: auto;
|
||
|
|
}
|
||
|
|
</style>
|