I can't get the textContent
from blink and change it. If I try the same with tag or div tag then it works fine.
<b-link :ref="index" v-b-toggle="`${index}`" @click="changeText(index)" >View More</b-link> changeText(index) { console.log(this.$refs[index][0].textContent); // undefined }
The difference between
<div />
and<b-link />
is that the former is the actual native HTML markup, while the latter provides a certain degree of Abstract components. To learn more, I recommend reading Native Web Components and their Vue counterparts.To change the contents of
<b-link />
, you must use Vue's reactivity:I found how to do this from vue js test case Usually this works
But since bootstrap-vue will return the vue component to access its elements, we need to use $el to access its properties.