Welcome to WuJiGu Developer Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
576 views
in Technique[技术] by (71.8m points)

关于 vue $refs 获取组件 this 指向的疑问

在使用 vue-seamless-scroll 组件的时候发现
父级页面 使用

<vue-seamless-scroll ref="seamlessScroll"><vue-seamless-scroll>

获取的 this.$refs.seamlessScroll

和在源码 mounted 打印的 this 竟然不一样...

是我理解错两个定义了吗 不应该是指向同一个组件吗,懵了 求大佬~~


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

求大佬解释下这个问题 我其他自定义的组件打印的 this 指向都是一样的 uid 也一样 ,
有没有大佬研究过他的源码的 在线等!


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to WuJiGu Developer Q&A Community for programmer and developer-Open, Learning and Share
...