zoukankan      html  css  js  c++  java
  • bg-route

    1.目录
      homework
        add.html
        online.html
        offline.html
      res
        script
          action
            homework
              add.js          
              
    2.add.html
    <div class="main" bg-action="action/homework/add">
      <ul class="b">
       <li><a href="#{{urlArr[0]}}" bg-target="main" class="cur"><b class="icon icon-h-icon-20"></b>线上作业</a></li>
      <li><a href="#{{urlArr[1]}}" bg-target="main"><b class="icon icon-h-icon-20"></b>线下作业</a></li>
      </ul>
      <div bg-name="main" bg-route="defaultUrl"></div>
    </div>
    3.add.js
    bingo.action('homework/add', function ($view, $var, $model, homeworkSrv, commonSrv) {
    console.log('homework/add', homeworkSrv);

    $view.defaultUrl = '';
    var urlArr = ['view/homework/online','view/homework/offline'];
    for(i in urlArr){
    if(location.href.indexOf(urlArr[i])>=0){
    // $('.b li').eq(i).find('a').trigger('click');
    $view.defaultUrl = urlArr[i];
    // if(i!=0) $('body').animate({'scrollTop':$('.wrap-content').offset().top},1000);
    break;
    };
    };
    if(!$view.defaultUrl) $view.defaultUrl=urlArr[0];
    $view.$update();
    });
  • 相关阅读:
    leetcode 18 4Sum
    leetcode 71 Simplify Path
    leetcode 10 Regular Expression Matching
    leetcode 30 Substring with Concatenation of All Words
    leetcode 355 Design Twitte
    leetcode LRU Cache
    leetcode 3Sum
    leetcode Letter Combinations of a Phone Number
    leetcode Remove Nth Node From End of List
    leetcode Valid Parentheses
  • 原文地址:https://www.cnblogs.com/iloveyou-sky/p/5706975.html
Copyright © 2011-2022 走看看