feat: 新增7个工具

工具:帮你选择(#)
工具:摩斯电码(#)
工具:生成随机数(#)
工具:数字转金额大写(#)
工具:文本对比(#)
工具:markdown编辑器(#)
工具:文字转图片(#)
This commit is contained in:
osiris
2023-12-18 11:50:00 +08:00
parent 1986fb8281
commit 04537038c5
15 changed files with 4199 additions and 11 deletions
+56
View File
@@ -0,0 +1,56 @@
<script setup lang="ts">
import { reactive } from 'vue'
import DetailHeader from '@/components/Layout/DetailHeader/DetailHeader.vue'
// import { copy } from '@/utils/string'
const info = reactive({
title: "生成随机数",
startNum: 1,
endNum: 100,
resNum: 0,
genStatus: false,
})
const random = () => {
info.genStatus = true
let count = 0
const genInterval = setInterval(() => {
info.resNum = Math.floor(Math.random() * (info.endNum - info.startNum + 1)) + info.startNum;
count++
if (count > 10) {
clearTimeout(genInterval)
info.genStatus = false
}
}, 50)
}
//copy
// const copyRes = async (resStr: string) => {
// copy(resStr)
// }
</script>
<template>
<div class="flex flex-col mt-3 ml-4 flex-1 mr-10">
<DetailHeader :title="info.title"></DetailHeader>
<div class="flex flex-col items-center">
<div>
<el-input-number v-model="info.startNum" :min="0" size="large"/>
<el-input-number v-model="info.endNum" :min="0" size="large" class="ml-5"/>
</div>
<div class="h-60 text-8xl leading-[15rem]">
{{ info.resNum }}
</div>
<div>
<el-button @click="random" type="primary" size="large" v-if="!info.genStatus">生成</el-button>
<el-button @click="random" type="primary" size="large" disabled v-else>生成...</el-button>
</div>
</div>
</div>
</template>
<style scoped>
</style>