找回密码
 立即注册
搜索

开发问题 swiper组件问题 设置vertical 不生效 ,多层嵌套在手机端不渲...

2
回复
1664
查看
[复制链接]

2

主题

5

帖子

35

积分

 楼主| 2019-10-28 09:09:16 显示全部楼层 |阅读模式
swiper组件的两个问题 1、设置vertical=‘true’后依然不能纵向滚动。2、swiper进行多层嵌套时,内容渲染在开发工具上正常,但是在手机端未正常渲染。
回复

使用道具 举报

0

主题

55

帖子

275

积分

2019-10-28 14:02:36 显示全部楼层
在swiper标签内部设置vertical="true",可以实现纵向滚动; swiper多层嵌套可以发下嵌套的代码示例吗?
回复

使用道具 举报

0

主题

1

帖子

5

积分

前天 16:09 显示全部楼层
v-liudan1@xiaom 发表于 2019-10-28 14:02 在swiper标签内部设置vertical="true",可以实现纵向滚动; swiper多层嵌套可以发下嵌套的代码示例吗? ...
{{ $item }}
import prompt from '@system.prompt' export default { data: { authors: [ { name: "李白", poems: [ "君不见,黄河之水天上来,奔流到海不复回。", "床前明月光,疑是地上霜。", "长风破浪会有时,直挂云帆济沧海。" ] }, { name: "杜甫", poems: [ "正是江南好风景,落花时节又逢君。", "会当凌绝顶,一览众山小。", "国破山河在,城春草木深。" ] }, { name: "李商隐", poems: [ "相见时难别亦难,东风无力百花残。", "此情可待成追忆,只是当时已惘然。", "春蚕到死丝方尽,蜡炬成灰泪始干。" ] } ] }, authorChange(e) { // 可以在这里处理作者切换的逻辑 console.log("切换到作者:", this.authors[e.index].name); console.log(e) prompt.showToast({ message: this.authors[e.index].name }) }, poemChange(authorIndex) { // 可以在这里处理诗歌切换的逻辑 console.log("作者", this.authors[authorIndex].name, "切换到诗:"); } } .container { flex-direction: column; width: 100%; height: 100%; } .outer-swiper { width: 100%; height: 100%; } .author-page { width: 100%; height: 100%; } .inner-swiper { width: 100%; height: 100%; } .poem-page { width: 100%; height: 100%; justify-content: center; align-items: center; background-color: #f0f0f0; } 开发工具上外层可以左右滑动,手机上不可以
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册