扫码关注官方订阅号
我无法从眨眼中获取 textContent 并更改它。如果我对标签或 div 标签进行相同的尝试,那么它就可以正常工作。
textContent
View More changeText(index) { console.log(this.$refs[index][0].textContent); // undefined }
我从vue js测试用例中找到了如何做到这一点 通常这有效
console.log(this.$refs[index][0].textContent);
但是由于 bootstrap-vue 将返回 vue 组件来访问其元素,因此我们需要使用 $el 来访问其属性。
console.log(this.$refs[index][0].$el.textContent);
微信扫码关注PHP中文网服务号
QQ扫码加入技术交流群
Copyright 2014-2026 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
PHP学习
技术支持
返回顶部
我从vue js测试用例中找到了如何做到这一点 通常这有效
但是由于 bootstrap-vue 将返回 vue 组件来访问其元素,因此我们需要使用 $el 来访问其属性。