<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>

          SupermodelBackbonejs 的數(shù)據(jù)模型層

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

          Supermodel 是 Backbonejs 的數(shù)據(jù)模型層。

          示例代碼:

          Post.has().many('comments', {
            collection: Comments,
            inverse: 'post'
          });
          
          Comment.has().one('post', {
            model: Post,
            inverse: 'comments'
          });
          
          var post = Post.create({
            id: 1,
            comments: [{id: 2}, {id: 3}, {id: 4}]
          });
          
          post.comments().length; // 3
          var comment = Comment.create({id: 5, post_id: 1});
          post.comments().length; // 4
          comment.post() === post; // true :D
          瀏覽 15
          點贊
          評論
          收藏
          分享

          手機掃一掃分享

          編輯 分享
          舉報
          評論
          圖片
          表情
          推薦
          點贊
          評論
          收藏
          分享

          手機掃一掃分享

          編輯 分享
          舉報
          <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>
                  91香蕉视频在线播放 | 日本不卡视屏 | xxxx日本少妇 | 国产一级色片 | 男女内射网站 |