直接貼代碼:html
源代碼:jquery
<?xml version="1.0" encoding="UTF-8"?>
<div xmlns="http://www.w3.org/1999/xhtml" xid="window" class="window" component="$UI/system/components/justep/window/window" design="device:mobile">
<div component="$UI/system/components/justep/model/model" xid="model"/>
<!-- 綁定可監控對象 -->
<input bind-textinput="name"></input>
<!-- name有值就顯示output,不然隱藏 text綁定了表達式 -->
<output bind-visible="name" bind-text="'hello,'+name.get()+'!'"></output>
</div>
post
JS:ui
define(function(require){
var $ = require("jquery");
var justep = require("$UI/system/lib/justep");
var Model = function(){
this.callParent();
//定義可監控對象
this.name=justep.Bind.observable("");
};
return Model;
});
this