AnalysisSystemForRadionucli.../src/views/spectrumAnalysis/components/SubOperators/Spectra.vue

79 lines
1.1 KiB
Vue
Raw Normal View History

2023-06-28 19:25:11 +08:00
<template>
<div class="spectra">
<div
:class="'spectra-item' + (item.value == innerValue ? ' active' : '')"
v-for="(item, index) in list"
:key="index"
@click="handleClick(item)"
>
{{ item.title }}
</div>
2023-06-28 19:25:11 +08:00
</div>
</template>
<script>
const list = [
{
title: 'Sample Data',
value: 'sample'
},
{
title: 'GasBg Data',
value: 'gasbg'
},
{
title: 'DetBg Data',
value: 'detbg'
},
{
title: 'QC Data',
value: 'qc'
}
]
export default {
props: {
value: {
type: String,
required: true
}
},
data() {
this.list = list
return {}
},
methods: {
handleClick(item) {
this.innerValue = item.value
}
},
computed: {
innerValue: {
set(val) {
this.$emit('input', val)
},
get() {
return this.value
}
}
}
}
2023-06-28 19:25:11 +08:00
</script>
<style lang="less" scoped>
.spectra {
width: 159px;
max-height: 200px;
overflow: auto;
&-item {
padding: 4px 14px;
cursor: pointer;
&:hover,
&.active {
background-color: #055565;
}
}
2023-06-28 19:25:11 +08:00
}
</style>