<p><a href="https://github.com/xiaowang1314/uniapp-plugin-collections/blob/master/markdowns/screenTextScroll.md" rel="nofollow noreferrer" target="_blank">github地址,喜欢的可以star下哦</a></p> <h3 id="articleHeader0">插件预览图</h3> <p><span class="img-wrap"><img data-src="/img/bVbp9D6?w=320&amp;h=185" src="/img/bVbp9D6?w=320&amp;h=185" alt="图片描述" title="图片描述" style="cursor: pointer; display: inline;"></span></p> <h4>使用教程</h4> <p>1.插件代码拷贝</p> <ul> <li>下载后把components目录下screenTextScroll.vue文件拷贝到自己项目目录下</li> </ul> <p>2.插件全局配置</p> <ul> <li>在项目里main.js中配置如下代码</li> </ul> <div class="widget-codetool" style="display:none;"> <div class="widget-codetool--inner"> <span class="selectCode code-tool" data-toggle="tooltip" data-placement="top" title="" data-original-title="全选"></span><br /> <span type="button" class="copyCode code-tool" data-toggle="tooltip" data-placement="top" data-clipboard-text="import screenTextScroll from './components/screenTextScroll.vue' Vue.component('textscroll',screenTextScroll) " title="" data-original-title="复制"></span> </div> </p></div> <pre class="hljs typescript"><code><span class="hljs-keyword">import</span> screenTextScroll <span class="hljs-keyword">from</span> <span class="hljs-string">'./components/screenTextScroll.vue'</span> <a href="http://www.js-code.com/tag/vue" title="浏览关于“Vue”的文章" target="_blank" class="tag_link">Vue</a>.component(<span class="hljs-string">'textscroll'</span>,screenTextScroll) </code></pre> <p>3.插件使用</p> <ul> <li>vue页面使用</li> </ul> <div class="widget-codetool" style="display:none;"> <div class="widget-codetool--inner"> <span class="selectCode code-tool" data-toggle="tooltip" data-placement="top" title="" data-original-title="全选"></span><br /> <span type="button" class="copyCode code-tool" data-toggle="tooltip" data-placement="top" data-clipboard-text="<template><br /> <view class=&quot;content&quot;><br /> <textscroll :list=&quot;list&quot;></textscroll><br /> </view><br /> </template></p> <p><script> <a href="http://www.js-code.com/tag/export" title="export" target="_blank">export</a> default { data() { return { list:['1分钟前,无夏购买了会员','2分钟前,无夏购买了会员','3分钟前,无夏购买了会员'] }; }, onLoad() {}, methods: {</p> <p> } }; </script></p> <style> </style> <p>" title="" data-original-title="复制"></span> </div> </p></div> <pre class="hljs xml"><code><span class="hljs-tag">&lt;<span class="hljs-name">template</span>&gt;</span> <span class="hljs-tag">&lt;<span class="hljs-name">view</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"content"</span>&gt;</span> <span class="hljs-tag">&lt;<span class="hljs-name">textscroll</span> <span class="hljs-attr">:list</span>=<span class="hljs-string">"list"</span>/&gt;</span> <span class="hljs-tag">&lt;/<span class="hljs-name">view</span>&gt;</span> <span class="hljs-tag">&lt;/<span class="hljs-name">template</span>&gt;</span> <span class="hljs-tag">&lt;<span class="hljs-name">script</span>&gt;</span><span class="javascript"> <span class="hljs-keyword"><a href="http://www.js-code.com/tag/export" title="浏览关于“export”的文章" target="_blank" class="tag_link">export</a></span> <span class="hljs-keyword">default</span> { data() { <span class="hljs-keyword">return</span> { <span class="hljs-attr">list</span>:[<span class="hljs-string">'1分钟前,无夏购买了会员'</span>,<span class="hljs-string">'2分钟前,无夏购买了会员'</span>,<span class="hljs-string">'3分钟前,无夏购买了会员'</span>] }; }, onLoad() {}, <span class="hljs-attr">methods</span>: { } }; </span><span class="hljs-tag">&lt;/<span class="hljs-name">script</span>&gt;</span> <span class="hljs-tag">&lt;<span class="hljs-name">style</span>&gt;</span><span class="undefined"> </span><span class="hljs-tag">&lt;/<span class="hljs-name">style</span>&gt;</span> </code></pre> <h5>兼容性</h5> <p>uni-app项目中使用都兼容</p>

本文固定链接: http://www.js-code.com/vue-js/vue-js_16714.html