mount和shallowMount 区别 mount会渲染整个组件树而shallowMount在挂载组件之前对所有子组件进行存根。shallowMount可以确保你对一个组件进行独立测试,有助于避免测试中因子组件的渲染输出而混乱结果。 使用建议 mount适合小组件测试shallowMount适合多场景测试(能用shallowMount就不用mount)