Home > Blockchain >  problem with $refs value in bootstarp-vue b-input
problem with $refs value in bootstarp-vue b-input

Time:09-24

while this.$refs.my_input.value works correctly with <input>, it returnd nothing wit <b-input>. this code:

<template>    
<b-input ref="my_input" @keyup.enter="AlertIt" />
</template>

script:

AlertIt() { alert(this.$refs.my_input.value) }

CodePudding user response:

should use this.$refs.my_input._data.localValue instead of this.$refs.my_input.value

CodePudding user response:

Try to use this.$refs['my_input']

More info here

  • Related