
根据想要传的值来传到对应的页面去
像这样的
- <div class=" am-list-main">
- <h3 class="am-list-item-hd pet_list_one_bt" >
- <a v-bind:id="item.id" v-bind:name="item.userName" class="test"> {{item.title}}</a>
- </h3>
- <div class="am-list-item-text pet_list_two_text">{{item.sContent}}</div>
- </div>
之后根据所在的层次来找到传值的位置
- mui("body").on('tap','.test',function(){
-
- var id=this.getAttribute("id");
-
- var username=this.getAttribute("name")
- //打开想要传值的相应页面
- mui.openWindow({
- id: "article_dedetails",
- url: "article_dedetails.html",
- extras: {
- //自定义扩展参数,可以用来处理页面间传值
- uid:id,
- username:username
- }
- });
- });
-
- 对应页面接收
-
- //B页面onload从服务器获取列表数据;
- window.onload = function(){
- //注意:若为ajax请求,则需将如下代码放在处理完ajax响应数据之后;
- mui.plusReady(function(){
- var self = plus.webview.currentWebview();//获取界面webview
- var uid = self.uid;
- var name = self.username;
-
- var vm;
- mui.get('http://api/v1/s/'+name+'/'+uid,{category: 'news'},function(data){
- vm=new Vue({
- el:"#content",
- data:{
- articlelist: data.value
- },filters: {
- //处理头像
- parsehead: function(head) {
-
- return head;
- }
- }
- })
- }, 'json');
-
- //关闭等待框
- plus.nativeUI.closeWaiting();
- //显示当前页面
- mui.currentWebview.show();
- });
- }
评价
排名
31
文章
25
粉丝
11
评论
6
ICP备案 :渝ICP备18016597号-1
网站信息:2018-2025TNBLOG.NET
技术交流:群号656732739
联系我们:contact@tnblog.net
公网安备:
50010702506256


欢迎加群交流技术
剑轩
可以,在写文章的时候,有需要写代码的地方,可以选择编辑器上的代码语言,这样文章能够更美观一些。
是伍尚金哇_v
翻了半天不到底![[泪]](http://www.tnblog.net/content/static/layui/images/face/12.gif)