Knockout.js - javascript function on data-bind

后端 未结 5 1479
天命终不由人
天命终不由人 2021-02-12 12:38

Is there a way i can call JavaScript function on data-bind like this:

         


        
5条回答
  •  孤街浪徒
    2021-02-12 12:49

    function trimString(value, maxLen) { //Return undefined, and short strings if (value === undefined) return undefined; if (value.length < maxLen) return value; return value.substring(0, (maxLen - 1)); }

提交回复
热议问题