classic-ui/components/NetworkSelect.vue
Danil Kovtonyuk 44f31f8b9f
init
2022-04-22 13:14:19 +10:00

46 lines
878 B
Vue

<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>