文章目录
- uniapp项目--青年帮新闻项目
- 1.项目提要
- 2.实际代码
uniapp项目–青年帮新闻项目
1.项目提要
导航滚动实现滚动条消失,使用的效果是渗透。
/deep/ ::-webkit-scrollbar {width: 4px !important;height: 1px !important;overflow: auto !important;background: transparent !important;-webkit-appearance: auto !important;display: block;}
本项目的接口没有涉及跨域跨域,有需要自己搜索
Vue跨域
的解决办法因为在小程序中不兼容渗透/deep/所以使用正则表达式替换一下。
res.data.content.replace(/<img/gi,'<img style="max-width:100%"')
//之前的写法在小程序中,详情页的内容显示过大 /deep/ img {max-width:100%;}
时间戳转日期(自己百度查一下也可),在
utils文件
中。
findIndex()
方法是 JavaScript 数组对象的一个内置方法,用于查找数组中满足指定条件的元素,并返回该元素在数组中的索引(index)。如果数组中没有满足条件的元素,则返回 -1。
2.实际代码
实际代码在
gitee
中:https://gitee.com/marygood/news_teenager