PopSelect.nvue
1.33 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<template>
<uv-popup ref="popRef">
<view class="pop_header">
<view style="width: 22px;" style="visibility: hidden;"></view>
<!-- <uv-icon name="close" size="22" class="pop_header_icon" ></uv-icon> -->
<text class="pop_header_text">{{ titleWithDefault }}</text>
<uv-icon name="close" size="22" class="pop_header_icon" @tap="handleCloseTypeSelect"></uv-icon>
</view>
<view class="l_type">
<view class="l_type_item" v-for="(item,index) in xAxisFields" :key="item.key"
:class="{'l_type_item_active':index === checkIndex}" @tap="handleChangeCheckType(index)">
<text class="l_type_item_text" :class="{'l_type_item_active_text':index === checkIndex}">{{ item.name }}</text>
</view>
</view>
</uv-popup>
</template>
<script setup>
import {
t
} from '@/plugins/index.js'
import {
computed
} from 'vue'
const props = defineProps({
title:{
type: String,
default: ''
},
options:{
type: Array,
default: () => []
},
direction: {
type: String,
default: 'bottom'
}
})
const titleWithDefault = computed(() => {
return props.title || t('app.title.kpiSelect')
})
// 打开弹窗
const popRef = ref(null)
const openPop = () => {
popRef.value.open(props.direction)
}
defineOptions({
openPop
})
</script>
<style lang="scss">
@import '@/styles/normal.scss';
</style>