ソースを参照

upload

master
HolyKnightIX 1年前
コミット
602cb0fa0c
1個のファイルの変更15行の追加0行の削除
  1. +15
    -0
      src/utils/index.js

+ 15
- 0
src/utils/index.js ファイルの表示

@@ -152,3 +152,18 @@ export function getDistances(lat1, lng1, lat2, lng2) {
return objData
}

/**
* @description:文本打字机
* @param {*} data (text,target,duration)
*/
export function typeWriter(text, target, duration) {
let i = 0;
let timer = setInterval(() => {
target += text[i];
if (i + 1 == text.length) {
clearInterval(timer);
} else {
i++;
}
}, duration || 100);
}

読み込み中…
キャンセル
保存