<div id="parent"><user-profile ref="profile"></user-profile></div>var parent = new Vue({ el: '#parent' })// 訪問子組件實例var child = parent.$refs.profile這是直接使用組件的方式,但如果是通過路由方式使用的組件該如何獲取組件實例呢
vue項目中如果直接使用組件可以通過vm.$refs獲取組件實例,但如果使用路由的話該如何獲取
胡子哥哥
2019-03-14 14:15:30