classic-ui/components/NetworkSelect.vue

46 lines
878 B
Vue
Raw Normal View History

2022-04-21 23:05:56 -04:00
<template>
<b-select
v-model="selectedNetwork"
class="network-select"
placeholder="Select a network"
size="is-small"
expanded
@input="updateNetwork()"
>
<option v-for="network in networks" :key="network.networkName" :value="network.networkName.toLowerCase()">
{{ network.networkName }}
</option>
</b-select>
</template>
<script>
import networkConfig from '@/networkConfig'
export default {
props: {
value: {
type: String,
required: true
}
},
data() {
return {
selectedNetwork: this.value,
networkConfig
}
},
computed: {
networks() {
const networkConfig = Object.assign({}, this.networkConfig)
delete networkConfig.netId333
return networkConfig
}
},
methods: {
updateNetwork() {
this.$emit('input', this.selectedNetwork)
}
}
}
</script>