这个你就加载结束,或者初始化事件,做if判断就可以
======
setTimeout(function() {
var a=duchamp.getWidgetByName("控件名").getValue();
if(a.lenght==0)
{
duchamp.getWidgetByName("A").setVisible(true);
duchamp.getWidgetByName("B").setVisible(false);
}
else
{
duchamp.getWidgetByName("A").setVisible(false);
duchamp.getWidgetByName("B").setVisible(true);
}
}, 1000);//1000毫秒等于一秒,自己根据需要修改时间