Skip to content

Instantly share code, notes, and snippets.

@schrockwell
Forked from mattraykowski/StationList.vue
Last active March 12, 2019 18:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save schrockwell/4fb1ef0113f98df49e3e07cf1ab18c44 to your computer and use it in GitHub Desktop.
Save schrockwell/4fb1ef0113f98df49e3e07cf1ab18c44 to your computer and use it in GitHub Desktop.
<template>
<div>
<p class="menu-label">Latest Callsigns</p>
<input class="input" type="text" placeholder="Filter stations..." v-model="stationFilter">
<div class="station-list">
<button
v-for="callsign in filteredStations"
:key="callsign"
@click="focusMarker(callsign)"
class="button is-small"
>{{callsign}}</button>
</div>
</div>
</template>
<style scoped>
.station-list {
display: flex;
flex-direction: column;
}
</style>
<script>
export default {
props: ["focusMarker"],
data: () => ({
stationFilter: ""
}),
computed: {
filteredStations() {
return this.$store.getters.stationCallsigns.filter(s =>
s.toUpperCase().includes(this.stationFilter.toUpperCase())
);
}
}
};
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment