npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

grid-input

v1.0.11

Published

格子输入,用于答题输入及校验输入结果

Readme

grid-input

组件介绍

grid-input是一个答题格子输入组件,详见下图: https://xydideo.gitee.io/blog/public-image/grid-input.gif

组件依赖

vue3、less

如需vue2支持可查看源码noode_modules/grid-input/src自行改造

组件使用

使用demo示例

<template>
  <div class="page">

    <grid-input ref="gridInputRef" ansChart="#" :que="str" :answer="answer" @handleSubmit="handleSubmit" />

    <div style="margin-left:20px;margin-top:40px; font-size:15px">
      <div>正确答案:今天四周五</div>
      <van-button type='primary' @click="handleCheck">点击答案检查</van-button>
    </div>

  </div>
</template>

<script setup>
import { ref, onMounted } from "vue"

import { GridInput } from 'grid-input'
import 'grid-input/style.css'

// 或者全局在main.js中引入
// import GridInput from 'grid-input'
// import 'grid-input/style.css'
// app.use(GridInput)

let str = "第1题:##是周三,明天是周#,后天是##。"
let answer = "今天四周五"
let gridInputRef = ref(null)

// blur时候触发
const handleSubmit = (ansArr, ansChart, allResult) => {
}

// 检查一下输入是否正确
function handleCheck() {
  gridInputRef.value.checkAns(answer)
}
</script>

组件api

Props

| 参数 | 说明 | 类型 | 默认值 | |----------|------------|--------|--------------------------------------| | ansChart | 答案占位字符 | String | # | | que | 题目 | String | 第1题:##是周三,明天是周#,后天是##。 |

Events

| 参数 | 说明 | 回调参数 | | -------- | ------------------ | ------- | | handleSubmit | 输入的信息,blur时候触发 | ansArr, ansChart, allResult | | handleCheck | 检查答案(子组件的方法)通过refs进行调用 | - |