02如何直接使用uni-app中提供的模板之公告滚动

用hBuibler将提供的模板下载下载,通过url上的路径找到你需要的模板对应的位置。
然后将这个文件夹中的diamante全部赋值过来就ok了。

	<view class="uni-padding-wrap">
		<view class="uni-swiper-msg-myflex">
			<view class="left-Iocn">
		             <icon class="iconfont icon-voice1"></icon>
			</view>
				
			<swiper class="limitp-hg" vertical="true" autoplay="true" circular="true" interval="3000">
				<swiper-item v-for="(item, index) in msg" :key="index">
					<navigator class="scrool-list-item">{{item}}</navigator>
				</swiper-item>
			</swiper>
		</view>
	</view>
msg : [
	'uniapp行业峰会频频亮相开发者反响热烈',
	'DCloud完成B2轮融资,uni-app震撼发布',
	'36氪热文榜推荐、CSDN公号推荐 DCloud'
  ]
<style scoped>
.img-iocn{
	width: 50rpx;
	height: 50rpx;
}
.scrool-list-item{
	color: red;
}
	
	.uni-swiper-msg-myflex{
		display: flex;
	}
	
	.left-Iocn{
		width: 40rpx;
		height: 60rpx;
		line-height: 60rpx;	
	}
	
	.limitp-hg{
		width:calc(100% - 50rpx);
		height: 60rpx;
		line-height: 60rpx;
	}
	
	.scrool-list-item{
		font-size: 30rpx;
	}
	
</style>
这次的问题是:
赋值过来要写css。比如重新设置滚动区域的高。
如果有变有小图标,必须设置滚动区域的宽度,否者显示不出来的哈。

猜你喜欢

转载自www.cnblogs.com/ishoulgodo/p/12727590.html