• 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();
    });
  • 相关阅读:
    偏函数 PartialFunction
    正则表达式的匹配
    scala api doc
    case语句的变量绑定(p @ T)
    再谈类型匹配
    副作用 检查前提条件
    The Return
    Codeforces Round #809 (Div. 2)
    Codeforces Round #812 (Div. 2)
    NOIP2022模拟赛二 By yzxoi 8.17
  • 原文地址:https://www.cnblogs.com/iloveyou-sky/p/5706975.html
Copyright © 2020-2023  润新知