Harry Liu

Harry's Blog

  • 主页
  • 文档
  • 随笔
所有文章 友链 关于我

Harry Liu

Harry's Blog

  • 主页
  • 文档
  • 随笔

go语言版本的随机单词生成库

2021-02-19

WordBot

项目介绍

WordBot是一个go语言版本的随机单词生成库。

有了它可以随机生成单词字符串.可以定义位数1-19位.
可以设置大小写模式.基本满足日程生成随机字符

有此项目诸君不用重复造轮子。

说明

安装

1
go get github.com/ser163/WordBot/generate

示例

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
package main

import (
"fmt"
"github.com/ser163/WordBot/generate"
)

func main() {
for i := 0; i < 5; i++ {
w, err := generate.GenRandomWorld(0, "none")
if err != nil {
fmt.Println(err)
break
}
fmt.Println(w.Chance, w.Word)
}
}

参数说明

1
func GenRandomWorld(length int, model string) (WorldList, error)
  • length 为要生成的字符串长度。0时随机单词长度为1-19之间。指定小于19的数字可以获取定长的字符串。

  • model 为生成的字符串大小写模式

    1. none 为小写模式。与GenRandomNone()功能相同

    2. upper 大写模式。与GenRandomUpper()功能相同

    3. lower 小写模式,与none相同,与GenRandomLower()功能相同

    4. mix 大小写混合模式,与GenRandomMix()功能相同

    5. title 首字母大写模式,与GenRandomTitle()功能相同

      地址

      Github: http://github.com/ser163/WordBot/

      Gitee: http://gitee.com/ser163/WordBot/

感谢

此项目算法参考: https://namefull.github.io

namefull–一个js版本随机单词生成器

  • go
  • 编程
  • Go

展开全文 >>

vxe-table 表格判断滚动条是否触底

2020-08-11

添加方法

  1. 在vxe-table组建上添加scroll方法:

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    <template>
    <div>
    <vxe-table
    ref="xTable"
    border
    round
    highlight-hover-row
    height="200"
    @scroll ="scrollEvnt"
    :data="tableData">
    <vxe-table-column type="seq" title="Number" width="80"><