<kbd id="afajh"><form id="afajh"></form></kbd>
<strong id="afajh"><dl id="afajh"></dl></strong>
    <del id="afajh"><form id="afajh"></form></del>
        1. <th id="afajh"><progress id="afajh"></progress></th>
          <b id="afajh"><abbr id="afajh"></abbr></b>
          <th id="afajh"><progress id="afajh"></progress></th>

          brix-bisheng數(shù)據(jù)雙向綁定庫

          聯(lián)合創(chuàng)作 · 2023-09-22 08:27

          brix-bisheng 是純粹的數(shù)據(jù)雙向綁定庫。

          安裝 Install

          $ bower install --save brix-bisheng'

          用法 Usage

          // 配置 Brix BiSheng 和依賴庫require.config({
              paths: {
                  jquery: 'bower_components/jquery/dist/jquery',
                  underscore: 'bower_components/underscore/underscore',
                  handlebars: 'bower_components/handlebars/handlebars'
                  'brix/bisheng': 'bower_components/brix-bisheng/dist/bisheng'
              }
          })// 加載 Brix BiShengrequire(['jquery', 'brix/bisheng'], function($, BiSheng){    // HTML 模板
              var tpl = '{{title}}'
              // 數(shù)據(jù)對象
              var data = {
                title: 'foo'
              }    // 執(zhí)行雙向綁定
              var bs = BiSheng.bind(data, tpl, function(content){        // 然后在回調(diào)函數(shù)中將綁定后的 DOM 元素插入文檔中
                  $('div.container').append(content)
              });    // 改變數(shù)據(jù) data.title,對應(yīng)的文檔區(qū)域會更新
              bs.apply(function() {
                  data.title = 'bar'
              })
          })

          方法 Methods

          共計(jì) 6 個(gè)公開方法:

          • BiSheng.bind( data, tpl, callback )

          • BiSheng.unbind( data, tpl ) DEPRECATED

          • BiSheng.watch( data, handler( changes ) )

          • BiSheng.unwatch( data, handler )

          • BiSheng.apply( handler ) DEPRECATED

          • BiSheng.auto( bool )

          瀏覽 14
          點(diǎn)贊
          評論
          收藏
          分享

          手機(jī)掃一掃分享

          編輯 分享
          舉報(bào)
          評論
          圖片
          表情
          推薦
          點(diǎn)贊
          評論
          收藏
          分享

          手機(jī)掃一掃分享

          編輯 分享
          舉報(bào)
          <kbd id="afajh"><form id="afajh"></form></kbd>
          <strong id="afajh"><dl id="afajh"></dl></strong>
            <del id="afajh"><form id="afajh"></form></del>
                1. <th id="afajh"><progress id="afajh"></progress></th>
                  <b id="afajh"><abbr id="afajh"></abbr></b>
                  <th id="afajh"><progress id="afajh"></progress></th>
                  一本色道久久爱牛牛 | 草在线观看免费视频 | 免费在线观看一区 | 影音先锋在线资源AV | 丁香五月婷婷啪啪 |