LiveAtlas/src/components/sidebar/PlayersSection.vue

63 lines
1.7 KiB
Vue
Raw Normal View History

2020-12-16 16:54:41 +00:00
<!--
2022-01-12 13:20:23 +00:00
- Copyright 2022 James Lyne
2020-12-16 16:54:41 +00:00
-
2021-07-25 14:12:40 +00:00
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
2020-12-16 16:54:41 +00:00
-
2021-07-25 14:12:40 +00:00
- http://www.apache.org/licenses/LICENSE-2.0
2020-12-16 16:54:41 +00:00
-
2021-07-25 14:12:40 +00:00
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
2020-12-16 16:54:41 +00:00
-->
2020-11-20 21:44:02 +00:00
<template>
<SidebarSection name="players" class="players">
<template v-slot:heading>{{ messageHeading }}</template>
2021-05-25 18:26:14 +00:00
<template v-slot:default>
2022-01-13 11:51:06 +00:00
<PlayerList :players="players" :search="searchEnabled" aria-labelledby="players-heading">
</PlayerList>
2021-05-25 18:26:14 +00:00
</template>
</SidebarSection>
2020-11-20 21:44:02 +00:00
</template>
2020-11-23 12:13:28 +00:00
<script lang="ts">
2021-07-21 15:19:18 +00:00
import {computed, defineComponent} from "@vue/runtime-core";
2020-11-23 12:13:28 +00:00
import {useStore} from "@/store";
import SidebarSection from "@/components/sidebar/SidebarSection.vue";
2022-01-12 13:20:23 +00:00
import PlayerList from "@/components/list/PlayerList.vue";
2020-11-23 12:13:28 +00:00
export default defineComponent({
components: {
2022-01-12 13:20:23 +00:00
PlayerList,
SidebarSection,
2020-11-23 12:13:28 +00:00
},
2021-07-21 15:19:18 +00:00
setup() {
const store = useStore(),
2021-07-29 18:16:37 +00:00
messageHeading = computed(() => store.getters.playersHeading),
2021-05-20 15:39:41 +00:00
2021-07-21 15:19:18 +00:00
searchEnabled = computed(() => store.state.ui.playersSearch),
2020-12-11 23:01:42 +00:00
2021-07-21 15:19:18 +00:00
players = computed(() => store.state.sortedPlayers),
2022-01-13 11:51:06 +00:00
maxPlayers = computed(() => store.state.maxPlayers || 0);
2021-07-21 15:19:18 +00:00
return {
messageHeading,
searchEnabled,
players,
2022-01-13 11:51:06 +00:00
maxPlayers
2020-11-23 12:13:28 +00:00
}
2021-05-25 18:26:14 +00:00
}
2020-11-23 12:13:28 +00:00
});
2020-11-20 21:44:02 +00:00
</script>
<style lang="scss" scoped>
::v-deep(.menu) {
scroll-margin-top: 8.2rem;
}
</style>