当前位置:网站首页>uniapp uni-list-item @click,uniapp uni-list-item带参数跳转
uniapp uni-list-item @click,uniapp uni-list-item带参数跳转
2022-07-02 09:41:00 【代码s贝多芬的音符】
<uni-list-item @click="goDetailsArena(item)" >
goDetailsArena(item) {
console.log(item)
// console.log(item);
let jsonObj = JSON.stringify(item.venueResult)
uni.navigateTo({
url: './arenaDetail/arenaDetail?item=' + jsonObj
})
},
点击无反应, 需加上link
<uni-list-item @click="goDetailsArena(item)" link >
点击跳转,uni.navigateto方法不执行。需加上 :to=
<uni-list-item direction="column" v-for="(item,index) in venueCollects" :to="`../../index/arenaDetail/arenaDetail?item=`+indext" @click="goDetailsArena(item)"
>
如果跳转要传递参数 使用JSON.stringify(item.venueResult) 编码。然后在第二个页面onload方法使用JSON.parse解码。
onLoad(e) {
this.ChangGuan = JSON.parse(e.item)
console.log("changguan:" + this.ChangGuan)
},
<uni-list-item direction="column" v-for="(item,index) in venueCollects" :to="`../../index/arenaDetail/arenaDetail?item=`+JSON.stringify(item.venueResult)" @click="goDetailsArena(item)"
>
官方:
组件名:uni-list
代码块:
uList
、uListItem
关联组件:uni-list-item
、uni-badge
、uni-icons
、uni-list-chat
List 列表组件,包含基本列表样式、可扩展插槽机制、长列表性能优化、多端兼容。
在vue页面里,它默认使用页面级滚动。在app-nvue页面里,它默认使用原生list组件滚动。这样的长列表,在滚动出屏幕外后,系统会回收不可见区域的渲染内存资源,不会造成滚动越长手机越卡的问题。
uni-list组件是父容器,里面的核心是uni-list-item子组件,它代表列表中的一个可重复行,子组件可以无限循环。
uni-list-item有很多风格,uni-list-item组件通过内置的属性,满足一些常用的场景。当内置属性不满足需求时,可以通过扩展插槽来自定义列表内容。
内置属性可以覆盖的场景包括:导航列表、设置列表、小图标列表、通信录列表、聊天记录列表。
涉及很多大图或丰富内容的列表,比如类今日头条的新闻列表、类淘宝的电商列表,需要通过扩展插槽实现。
下文均有样例给出。
uni-list不包含下拉刷新和上拉翻页。上拉翻页另见组件:uni-load-more(opens new window)
#介绍
注意事项
为了避免错误使用,给大家带来不好的开发体验,请在使用组件前仔细阅读下面的注意事项,可以帮你避免一些错误。
- 组件需要依赖
sass
插件 ,请自行手动安装 - 组件内部依赖
'uni-icons'
、uni-badge
组件 uni-list
和uni-list-item
需要配套使用,暂不支持单独使用uni-list-item
- 只有开启点击反馈后,会有点击选中效果
- 使用插槽时,可以完全自定义内容
- note 、rightText 属性暂时没做限制,不支持文字溢出隐藏,使用时应该控制长度显示或通过默认插槽自行扩展
- 支付宝小程序平台需要在支付宝小程序开发者工具里开启 component2 编译模式,开启方式: 详情 --> 项目配置 --> 启用 component2 编译
- 如果需要修改
switch
、badge
样式,请使用插槽自定义 - 在
HBuilderX
低版本中,可能会出现组件显示undefined
的问题,请升级最新的HBuilderX
或者cli
#基本用法
- 设置
title
属性,可以显示列表标题 - 设置
disabled
属性,可以禁用当前项
边栏推荐
- Log4j2
- 6. Introduce you to LED soft film screen. LED soft film screen size | price | installation | application
- How to Create a Beautiful Plots in R with Summary Statistics Labels
- 抖音海外版TikTok:正与拜登政府敲定最终数据安全协议
- ESP32 Arduino 引入LVGL 碰到的一些问题
- Redis exceeds the maximum memory error oom command not allowed when used memory & gt; ' maxmemory'
- Redis超出最大内存错误OOM command not allowed when used memory &gt; 'maxmemory'
- easyExcel和lombok注解以及swagger常用注解
- Implementation of address book (file version)
- [visual studio 2019] create and import cmake project
猜你喜欢
Redis超出最大内存错误OOM command not allowed when used memory &gt; 'maxmemory'
HOW TO CREATE A BEAUTIFUL INTERACTIVE HEATMAP IN R
MySQL comparison operator in problem solving
念念不忘,必有回响 | 悬镜诚邀您参与OpenSCA用户有奖调研
Flesh-dect (media 2021) -- a viewpoint of material decomposition
Data analysis - Matplotlib sample code
Tdsql | difficult employment? Tencent cloud database micro authentication to help you
2022年4月17日五心红娘团队收获双份喜报
PgSQL string is converted to array and associated with other tables, which are displayed in the original order after matching and splicing
excel表格中选中单元格出现十字带阴影的选中效果
随机推荐
HOW TO CREATE A BEAUTIFUL INTERACTIVE HEATMAP IN R
xss-labs-master靶场环境搭建与1-6关解题思路
Easyexcel and Lombok annotations and commonly used swagger annotations
Power Spectral Density Estimates Using FFT---MATLAB
Liftover for genome coordinate conversion
excel表格中选中单元格出现十字带阴影的选中效果
[idea] use the plug-in to reverse generate code with one click
A sharp tool for exposing data inconsistencies -- a real-time verification system
6方面带你认识LED软膜屏 LED软膜屏尺寸|价格|安装|应用
Bedtools tutorial
How to Add P-Values onto Horizontal GGPLOTS
File operation (detailed!)
可昇級合約的原理-DelegateCall
程序员成长第六篇:如何选择公司?
微信小程序利用百度api达成植物识别
YYGH-9-预约下单
Three transparent LED displays that were "crowded" in 2022
vant tabs组件选中第一个下划线位置异常
HOW TO CREATE AN INTERACTIVE CORRELATION MATRIX HEATMAP IN R
CMake交叉编译