SOURCE

console 命令行工具 X clear

                    
>
console
// global filters
// if you like lodash, you can write `Yox.filter(_)`
Yox.filter({
  formatDate: function (value) {
    var month = value.getMonth() + 1
    var date = value.getDate()
    return [
      value.getFullYear(),
      month < 10 ? '0' + month : month,
      date < 10 ? '0' + date : date
    ].join('-')
  },
  formatContent: function (value) {
    return value.replace(/yox/g, '<em>yox</em>')
  }
})
new Yox({
  el: '#app',
  template: '#template',
  data: {
    birthday: new Date(),
    content: 'yox is a good boy'
  }
})
<div id="app"></div>
<script id="template" type="text/plain">
	<div>
    <p>
    	{{ birthday }}
    </p>
    
    <p>
    	{{ formatDate(birthday) }}
    </p>
    
    <p>
    	{{{ formatContent(content) }}}
    </p>
    
  </div>
</script>
em {
  color: red;
}

本项目引用的自定义外部资源