该组件用于滚动通告场景,有多种模式可供选择
#平台差异说明
App(vue) | App(nvue) | H5 | 小程序 |
---|---|---|---|
√ | √ | √ | √ |
#基本使用
- 通过
text
参数设置需要滚动的内容
<template><view><u-notice-bar :text="text1"></u-notice-bar></view>
</template><script>export default {data() {return {text1: 'uView UI众多组件覆盖开发过程的各个需求,组件功能丰富,多端兼容。让您快速集成,开箱即用'}}}
</script>
copy
#可关闭
通过mode
配置为closable
让右侧显示关闭按钮
<template><view><u-notice-bar :text="text1" mode="closable"></u-notice-bar></view>
</template><script>export default {data() {return {text1: 'uView UI众多组件覆盖开发过程的各个需求,组件功能丰富,多端兼容。让您快速集成,开箱即用'}}}
</script>
copy
#配置滚动速度和跳转
speed
可配置横向滚动速度url
可配置跳转
<template><view><u-notice-bar :text="text1" mode="closable" speed="250" url="/pages/componentsB/tag/tag"></u-notice-bar></view>
</template><script>export default {data() {return {text1: 'uView UI众多组件覆盖开发过程的各个需求,组件功能丰富,多端兼容。让您快速集成,开箱即用'}}}
</script>