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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@findsoft/ellipsis

v1.1.0

Published

文本省略

Downloads

7

Readme

ellipsis

一个基于vue3&ant-design-vue2的文本省略组件

支持三种方式省略文本

  1. 长度 isCharLimit
  2. 行数 isLineLimit
  3. 高度 isHeightLimit

Install

npm install @findsoft/ellipsis

Quick Start

<!-- vue -->
<template>
  <div class="about">
    <h1>This is a demo</h1>
    <a-ellipsis v-bind='ellipasisLists[0]'></a-ellipsis>
    <a-ellipsis v-bind='ellipasisLists[1]'></a-ellipsis>
    <a-ellipsis v-bind='ellipasisLists[2]'></a-ellipsis>
  </div>
</template>
import '@findsoft/ellipsis/dist/ellipsis.css';
import Ellipsis from '@findsoft/ellipsis';

export default {
  components: {
    aEllipsis: Ellipsis,
  },
  setup() {
    const text = '史蒂夫·乔布斯,是一名美国企业家、营销家和发明家,苹果公司的联合创始人之一,曾任董事长及首席执行官职位,NeXT创办人及首席执行官,也是皮克斯动画的创办人并曾任首席执行官,2006年为华特迪士尼公司的董事会成员。2017年9月苹果发布会举行的地方,以他命名为 Steve Jobs Theater 。';
    
    const ellipasisLists = [
      {
        type: 'length',
        text,
        isCharLimit: true,
        maxLength: 50,
      },
      {
        type: 'rows',
        text,
        isLineLimit: true,
        limitLineNumber: 3,
      },
      {
        type: 'height',
        text,
        isHeightLimit: true,
        limitHeightNumber: 60,
      },
    ];
    return {
      ellipasisLists
    }
  }
};

Props

| 参数 | 说明 | 类型 | 默认值 | | ---- | ---- | ---- | ---- | | text | 需要省略的字符 | String | '' | | ellipsisType | 超出时显示的内容 | String | ... | | fontSize | 字体大小 | Number | 14 | | showAll | 悬停是否显示全文内容 | Boolean | true | | 长度参数 | | | | | isCharLimit | 是否根据长度限制 | Boolean | false | | maxLength | 长度 | Number | 20 | | 行数参数 | | | | | isLineLimit | 是否根据行数限制 | Boolean | false | | limitLineNumber | 行数 | Number | 1 | | 高度参数 | | | | | isHeightLimit | 是否根据高度限制 | Boolean | false | | limitHeightNumber | 高度 | Number | 0 |