清除ST.future.Component预填数据的方法

Method to clear pre-filled data of a ST.future.Component

在使用 ST.component("locator"); API 时是否有清除输入字段的方法?

使用 ST.component("locator").setValue(""); 会导致以下错误:

TypeError: ST.component(...).setValue is not a function...




PS: 老论坛现在永久关闭了吗?有没有办法查看旧问题?

编辑:好像昨天另一个论坛挂了,所以PS。

如果它是一个 Ext JS 字段,您将需要在 Sencha Test 中使用 ST.field API,它有一个 setValue 方法。此方法在更通用的 ST.component API.

上不可用
ST.field('myfield')
    .setValue('');

或者如果是普通的输入框(不是Ext JS组件),那么你可以这样做:

ST.element('@myfield')
    .execute(function(field) {
        field.dom.value = '';
    });