Fe-interview: [vue] 在组件中怎么访问到根实例?

Created on 22 Jun 2019  ·  5Comments  ·  Source: haizlin/fe-interview

[vue] 在组件中怎么访问到根实例?

vue

Most helpful comment

无限循环调用$parent直到没有这个属性为止

All 5 comments

通过
```js
this.$root
````

无限循环调用$parent直到没有这个属性为止

楼上是假尤大?

无限循环调用$parent直到没有这个属性为止

不是有一个this.$root吗?

Was this page helpful?
0 / 5 - 0 ratings