index.vue
1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<template>
<uni-nav-bar :title="title" statusBar="true" fixed="true" v-if="isLeftText"></uni-nav-bar>
<uni-nav-bar v-else @clickLeft="goBack" :title="title" statusBar="true" fixed="true" :right-text="rithtText" @clickRight="handleAll">
<template #left>
<image src="/static/back-filled.png" class="left-image"></image>
</template>
</uni-nav-bar>
</template>
<script setup>
import {useStore} from "vuex";
// 获取父组件数据
const props = defineProps({
title: {
type: String,
default: ''
},
rithtText:{
type:String,
default:''
},
isLeftText:{
type:Boolean
}
});
// ------定义变量------
const emit = defineEmits(); //子组件向父组件事件传递
const store = useStore(); //vuex获取、储存数据
const users = store.state.user; //vuex获取、储存数据
const taskStatus = users.taskStatus;
// ------定义方法------
const goBack = () => {
emit('goBack');
};
const handleAll = ()=>{
emit('handleAll')
}
</script>
<style lang="scss" scoped>
.left-image {
height: 64rpx;
width: 32rpx;
}
</style>