0.0.1 • Published 2 years ago

@noyid/vue-typing v0.0.1

Weekly downloads
-
License
-
Repository
github
Last release
2 years ago

vue-typing —— 实现打字效果

vue组件,实现打字效果 demo

引用

方式一:单页面: script 引用 lib 目录下生成物,注意路径

<script src="lib/typing.umd.min.js"></script>
<link rel="stylesheet" href="lib/typing.css">

方式二:将 src/components 下的 Typing 文件夹拷贝到你的组件目录,自行修改

方式三:npm安装

npm install @noyid/vue-typing --save

然后使用

import Typing from '@noyid/vue-typing'
import '@noyid/vue-typing/lib/typing.css'
    export default {
        ...
        components:{
            Typing
        },
        ...
    }

使用示例

单行覆写

<Typing :loopCount="1" :texts="['进销存应用','项目管理','财务统计报表']" />

多行输入

<Typing :loopCount="1" :texts="['进销存应用\n项目管理\n财务统计报表']"/>

属性说明

属性名类型默认值说明
textsArray[]文本数组,数组长度>1时为覆写形式
typeSpeednumber50键入单个字符速度(毫秒)
deleteSpeednumber20删除单个字符速度(毫秒)
typeDelaynumber1000延迟键入(毫秒)
deleteDelaynumber1000延迟删除(毫秒)
loopCountnumberInfinity一直循环
typeCompleteCursorVisiblebooleantrue输入完成是否显示光标