[Vuejs]-How to add item from select dropdown โ€“ keen-ui

1๐Ÿ‘

โœ…

I think you are not using the ga variable in data(). Just correct it and options will be shown in the dropdown.

data() {
        return {
            baseUrl: 'https://example.com/hive/stats/bedrock',
            game: '',
            ga: ['dr', 'wars', 'hide', 'murder', 'sg'],
            bg: '',
            player: ''
        }
    }

EDIT: In your computed method url you can add this:

if (this.game) {
  url += this.baseUrl + `/${this.game}`
}

and for ui-select directive use :value.sync instead of โ€˜v-model. Also if you need to listen to any changes then use@input` method.

:value.sync="game"

Updated codepen link with working code:
https://codepen.io/sudheer-ranga/pen/vYNKmLZ

๐Ÿ‘คSpiritOfDragon

Leave a comment