0

i have on 2 value v-select

<v-select
            v-model="selectedRangeSG"
            outlined
            dense
            class="select-no-color"
            :items="['All Treshold', 'Manual Input']"
            :key="selectedRangeSG"
            @change="showDialogSG"
          />

and i created modal when item selected by default

private selectedRangeSG = 'All Treshold'

i try to set dialog false when klik cancel

this is my code

 private showDialogSG () {
    if (this.selectedRangeSG === 'Manual Input') {
      this.dialogSG = true
    } else if (this.selectedRangeSG === 'All Treshold') {
      this.dialogSG = false
    } else {
      console.log('Err')
    }
  }

how to set show dialog when i selected Manual Input, then the dialog can pop up again

Badrudin
  • 21
  • 4
  • Which is Vue version are you using, Vue3 or Vue2? If you using Vue3, you should change variable `selectedRangeSG` to ref. Ex `const selectedRangeSG = ref('All Treshold')`. Now the variable `selectedRangeSG` can be reactive, it will be updated value when user change select. – DinhTX Apr 13 '23 at 06:49

0 Answers0