🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
# 获得上一级的栏目名称 说明:这里 `pageParam` 是关键! ### 1、点击“栏目二” ![](https://box.kancloud.cn/2016-08-25_57beba4ff301f.png) ``` <ul class="aui-grid-sixteen"> <li class="aui-col-xs-3 aui-text-center" tapmode onclick="openClassify('news','栏目二')"> <span class="aui-iconfont aui-icon-form aui-text-info"></span> <p>栏目二</p> </li> </ul> <script> function openClassify(name,title){ var delay = 0; if(api.systemType != 'ios'){ delay = 300; } api.openWin({ name: ''+name+'_win', url: ''+name+'_win.html', bounces: false, delay:delay, pageParam:{ title:title //传参,关键 } }); } </script> ``` ### 2、这个栏目自动得到相关名称 ![](https://box.kancloud.cn/2016-08-25_57beba501348e.png) ``` <header class="aui-bar aui-bar-nav aui-bar-danger" id="aui-header"> <div class="aui-iconfont aui-icon-left aui-pull-left" tapmode onclick="closeWin()"></div> <div class="aui-title" id="title">标题</div> </header> <script type="text/javascript"> apiready = function(){ $api.text($api.byId("title"),api.pageParam.title); } </script> ```