Skip to main content
Cypress应用

Vue API

方法

mount

import { mount } from 'cypress/vue'
描述

用于独立挂载Vue组件。负责在Cypress的沙盒iframe中渲染组件,并处理任何框架特定的清理工作。

签名

mount(originalComponent: { new (...args: any[]): ; __vccOpts: any; }, options?: MountOptions): Cypress.Chainable<MountReturn>

mount参数
名称类型描述
originalComponentnew (...args: any[])要在测试中挂载的组件
optionsMountOptions (可选)挂载组件的选项

接口

MountOptions

(Vue 3 MountingOptionsVue Test Utils)

MountReturn

mount函数返回的类型

成员
名称类型描述
wrapperVueWrapperVue Test Utils的wrapper
componentVueComponent组件实例