uni-app项目展示屏幕文字滚动效果

5次阅读

共计 460 个字符,预计需要花费 2 分钟才能阅读完成。

github 地址,喜欢的可以 star 下哦
插件预览图

使用教程
1. 插件代码拷贝
下载后把 components 目录下 screenTextScroll.vue 文件拷贝到自己项目目录下
2. 插件全局配置
在项目里 main.js 中配置如下代码
import screenTextScroll from ‘./components/screenTextScroll.vue’

Vue.component(‘textscroll’,screenTextScroll)

3. 插件使用
vue 页面使用
<template>
<view class=”content”>
<textscroll :list=”list”/>
</view>
</template>

<script>
export default {
data() {
return {
list:[‘1 分钟前,无夏购买了会员 ’,’2 分钟前,无夏购买了会员 ’,’3 分钟前,无夏购买了会员 ’]
};
},
onLoad() {},
methods: {

}
};
</script>

<style>

</style>

兼容性
uni-app 项目中使用都兼容

正文完
 0