Vue API
方法
mount
import { mount } from 'cypress/vue'
描述 | 用于独立挂载Vue组件。负责在Cypress的沙盒iframe中渲染组件,并处理任何框架特定的清理工作。 |
签名 | mount(originalComponent: { new (...args: any[]): ; __vccOpts: any; }, options?: MountOptions): Cypress.Chainable<MountReturn> |
名称 | 类型 | 描述 |
originalComponent | new (...args: any[]) | 要在测试中挂载的组件 |
options | MountOptions (可选) | 挂载组件的选项 |
接口
MountOptions
(Vue 3 MountingOptions 或 Vue Test Utils)
MountReturn
mount
函数返回的类型
名称 | 类型 | 描述 |
wrapper | VueWrapper | Vue Test Utils的wrapper |
component | VueComponent | 组件实例 |