1.0.1 • Published 11 months ago

vue-typer-next v1.0.1

Weekly downloads
-
License
-
Repository
-
Last release
11 months ago

vue-typer-next

npm npm vue3

Vue3 component that simulates a user typing, selecting, and erasing text.

Checkout the offical project here.

Table of contents

Installation

npm install --save vue-typer-next

Global import

Install the component:

import { createApp } from 'vue'
import vueTyperNext}from "vue-typer-next";
import "vue-typer-next/dist/style.css";
import App from './App.vue'

const app = createApp(App)

app.use(vueTyperNext)
app.mount('#app')

Manual import

<template>
	 <vueTyperNext data="departResultStri1ngs"/>
</template>
<script setup lang="ts">
  import { vueTyperNext } from "vue-typer-next";
  import "vue-typer-next/dist/style.css";
</script>

Usage

To get started simply add the vue-typer-next custom element to your template and pass the text, which should be typed to the data property. In addition you need to pass an element with the class prefix or suffix to the slot, which will be used as a wrapper.

Minimal setup:

 <vueTyperNext data="departResultStri1ngs"/>

Properties

You can make use of the following properties in order to customize your typing expirience:

PropertyTypeDefaultDescription
dataArray/StringThe content that needs to be printed can be a string or an array, and the array will automatically add a line break after it
handlerNumNumber1Number of executions, must be greater than 0
typeSpeedNumber15type speed in milliseconds
typeSpeedLineNumber100Line printing speed
cursorCharString_character for cursor
backBooleanfalseWhen the data is an array, will the subsequent values of the data overwrite the previous value
backSpeedNumber30Fallback speed
scrollDomStringScroll container class or id

Events

You can listen to the following events:

EventDescriptionUsage
completeAll typing is complete@complete="doSmth()"
lineCompleteone line is complete@lineComplete="doSmth()"

Methods

You can listen to the following methods:

methodDescriptionparameter
startstart typer
pausepause typer

Slots

You can listen to the following slots:

nameDescription
prefixprefix
suffixsuffix

Features

None


License

MIT

1.0.1

11 months ago

1.0.0

12 months ago