西安市城乡与住房建设厅网站安徽省建设干部网站
web/
2025/10/9 2:15:29/
文章来源:
西安市城乡与住房建设厅网站,安徽省建设干部网站,网站运营做产品需要哪些知识,做外汇看的国外网站使用vue组件iscroll实现一个横向菜单#xff0c;可是却不能滑动#xff0c;给父元素ul写死一个宽度可以滑动。但是#xff0c;我在computed里计算宽度#xff0c;直接路由进去不能滑动#xff0c;当我进入别的组件(切换路由)回来又可以滑动了示例地址#xff1a;http://o…使用vue组件iscroll实现一个横向菜单可是却不能滑动给父元素ul写死一个宽度可以滑动。但是我在computed里计算宽度直接路由进去不能滑动当我进入别的组件(切换路由)回来又可以滑动了示例地址http://onepoint.stg4.v5time.net/news/1{{item.name}}#wrapper{position: absolute;z-index: 1;height: 40px;left: 0;width: 100%;overflow: hidden;}#scroller{position: absolute;z-index: 1;-webkit-tap-highlight-color: rgba(0,0,0,0);}#scroller ul{width: 100%;height: 100%;text-align: center;}#scroller li{float:left;height: 30px;line-height: 30px;width:1.6rem;list-style-type: none;}#scroller .bot{border-bottom:2px solid rgb(37, 190, 169);}import IScroll from iscroll/build/iscroll-lite.jsexport default{props: {menu: {type: Array},selected: {type: Boolean,require: false,default: false}},data () {return {index: 0}},computed: {getWidth () {return width: this.menu.length * 1.6 rem}},ready () {var myScroll new IScroll(this.$els.wrapper, {scrollX: true, scrollY: false})myScroll.say },methods: {checkIt (index, item) {var lis this.$els.ul.childrenlis[this.index].classList.remove(bot)this.index indexlis[index].classList.add(bot)this.$dispatch(click-msg, item)}}}
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/web/89388.shtml
如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!