pass 0.0.15+
Typed 打字基础用法
text
属性可以是字符串,也可以是数组,loop
控制循环播放
|
展开查看
<mg-typed
:text="['welcome mango-ui doc','This is test text']"
loop
/>
1
2
3
4
2
3
4
自定义光标
cursor
设置光标,当然也可以传入null隐藏光标
❤
展开查看
<mg-typed
:text="['welcome mango-ui doc','This is test text']"
loop
cursor="❤"
/>
1
2
3
4
5
6
2
3
4
5
6
设置速度
speed
设置打字速度,backspaceSpeed
设置删除时的速度,单位 毫秒
这个例子打字速度就更快些
|
展开查看
<mg-typed
:text="['welcome mango-ui doc','This is test text']"
loop
cursor="❤"
:speed="50"
:backspaceSpeed="100"
/>
1
2
3
4
5
6
7
8
2
3
4
5
6
7
8
Typed Attributes
参数 | 说明 | 类型 | 可选值 | 默认值 |
---|---|---|---|---|
text | 文本内容 | string/string[] | - | - |
loop | 是否循环 | boolean | - | false |
cursor | 光标 | string | - | | |
speed | 打字速度 | number | - | 300 |
backspaceSpeed | 回删速度 | number | - | 100 |
gap | 两个字符串之间的停顿 | number | - | number |
Typed Event
--