Skip to content

generateLicensePlate

函数描述

随机生成车牌号

基础用法

ts
import { generateLicensePlate } from '@zhonghe/utils';

const license = generateLicensePlate();
console.log(license);

类型声明

ts
/** 随机生成车牌号 */
declare function generateLicensePlate(): string;

在线 Demo

commonType
基础类型判断
随机生成的车牌:
<template>
	<div>
    <button @click="generate">点击生成随机车牌</button>
    <div>随机生成的车牌:{{ license}}</div>
  </div>
</template>
<script lang="ts" setup>
import { generateLicensePlate } from '@zhonghe/utils';
import { ref } from "vue";

const license = ref("");
function generate() {
  license.value = generateLicensePlate();
}
</script>
<style scoped></style>