uniapp返回上一页时报错: Cannot destructure property ‘firstElementChild‘ of ‘rootRef.value‘ as it is null.

报错如下:

1. 检查一下是不是使用了onShow方法

2.在onShow中加上nextTick