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

cross-text-highlight

v0.1.7

Published

``` npm i cross-text-highlight ``` # 基于vue-search-highlight 的跨标签可标注序号的文本高亮插件

Readme

cross-label-text-annotation

Project setup

npm i cross-text-highlight

基于vue-search-highlight 的跨标签可标注序号的文本高亮插件

演示案例图展示

参数配置说明

说明除了 基于 vue-search-highlight 的基本props之外,额外增加了一些配置

// 标记高
markWidth: { type: String, default: '32px' }
// 标记宽
markHeight: {
type: String,
default: '32px'
},
// 标记颜色
startColor: {
type: String,
default: '#ff9632'
},
// 标记颜色
endColor: {
type: String,
default: '#ffff00'
},
// 文字颜色
textColor: {
type: String,
default: '#fff'
},
// 边框颜色
borderColor: {
type: String,
default: '#ff9632'
},
// 边框定位
markLeft:{
type: String,
default: '-30px'
},
// 边框定位
markTop: {
type: String,
default: '-16px'
},
// 文字粗细
markWeight: {
type: String,
default: '700'
},
// 文字大小
markFontSize: {
type: String,
default: '22px'
},

markZoom: {
type: String,
default: '.65'
},
// 是否开启标记
isNeedMark: {
type: Boolean,
default: false
},
// 对应父元素名称
pEle: {
type: String,
default: 'htmlContent'
}

展示用法案例

<template>
    <div id="app">
    <!-- 外层的id htmlContent 一定要和组件属性pEle保持一致  -->
        <div ref="htmlContent" id="htmlContent">
            <button @click="goTo">指定位置</button>
            <button @click="goBfter">第一个</button>
            <button @click="goAfter">第二个</button>
            <button @click="goAfter2">第三个</button>
            <crossTextHighLight
                    ref="search"
                    @current-change="currentChange"
                    :content="text"
                    :keyword="keyword"
                    :is-need-mark="true"
                    :pEle="`htmlContent`"
                    @match-count-change="matchCountChange"
                    :highlightStyle="`background: #ffff00`"
                    :currentStyle="`background: rgb(224, 234, 250)`"
            />

        </div>
    </div>
</template>

<script>
    import crossTextHighLight from "crossTextHighLight";
    export default {
        name: 'App',
        components: {
            crossTextHighLight
        },
        data(){
            return {
                text: ``,
                keyword: "",
                matchCount: 0,
            }
        },
        methods: {
            currentChange(){

            },
            matchCountChange (count) {
                this.matchCount = count
            },
            goTo(){
                this.$refs.search.scrollToOrder(2,this.$refs.search)
            },
            goBfter(){
                this.$refs.search.scrollToOrder(1,this.$refs.search)
            },
            goAfter(){
                this.$refs.search.scrollToOrder(2,this.$refs.search)
            },
            goAfter2(){
                this.$refs.search.scrollToOrder(3,this.$refs.search)
            }
        }
    }
</script>

<style>
    *{
        line-height: 80px;
    }
    #htmlContent{
        height: 600px;
        overflow-y: auto;
    }
</style>

更新记录

  1. 2024-8-27
  • 可自定义是否开启默认的右键事件,当前里面只有一个复制操作
  • 对外暴露事件 'selection-change' ,包含了位置信息,以及文本内容
  • bug:修复了更新节点时候的类名错误
  1. 2024-8-29
  • 过滤了同类型的font标签,只保留特征font标签
  • 以及一些bug修复