wxml:
<view class='marquee_container'>
<view class='marquee_text' style='{ { orientation }}:{ { marqueeDistance }}px;
font-size: { {size}}px;'>
{ { text }}
</view>
</view>
文件名.js:
// components/common/marquee/marquee.js
Component({
/**
* 组件的属性列表
*/
properties: {
text: {
type: String,
value: 'ILoveQwei',
observer(nv, ov, path) {
if (nv) {
console.log(nv);
let _this = this;
_this.setData({
text: nv
}, res => {
var length = _this.data.text.length * _this.data.size;