<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>template.helper</title>
</head>
<body>
<div id="box"></div>
<script type="text/html" id="template">
<h1>{{ 100 | fn:'level' }}</h1>
</script>
<script src="../libs/jquery.js"></script>
<script src="../libs/template.js"></script>
<script>
template.helper( 'fn' , function( a , b ){
if( b == 'level' ){
return a>90 ? '优':'中' ;
}
});
var content = template( 'template' )
$('#box').html( content )
</script>
</body>
</html>