New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

text-overflow-title

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

text-overflow-title

vue3 文本溢出组件与指令,文本溢出,自动计算加上tooltips。文本超出宽度,自动隐藏,鼠标hover 加上提示

latest
Source
npmnpm
Version
0.0.4
Version published
Weekly downloads
7
-12.5%
Maintainers
1
Weekly downloads
 
Created
Source

文本溢出处理

组件

<template>
  <div>
    <div style="width: 100px;margin-bottom: 20px;">
      <bk-overflow-title>文本超出33333222222222222222222222222</bk-overflow-title>
    </div>
    <div style="width: 100px;margin-bottom: 20px;">
      <bk-overflow-title type="tips">
        文本超出33333222222222222222222222222
      </bk-overflow-title>
    </div>
  </div>
</template>


overflowTitle 组件属性

参数说明类型可选值默认值
content文本内容。没有的话去default slotString
--
--
type默认给文本加上title,如果tips,则鼠标悬浮添加添加tooltips,但是如果不是纯文本String
tipstitle
title
calType计算文本宽度方式,默认通过dom计算机文本宽度,canvas则通过measureText计算String
domcanvas
dom
resizeable是否监听文本内容变化Boolean
--
false

指令

<template>
  <div>
    <div style="width: 100px;margin-bottom: 20px;">
      <div
        v-overflow-title
        class="text-ov"
      >
        222222222222222222222222
      </div>
    </div>
  </div>
</template>
<script >

  import { overflowTitle } from 'bkui-vue';
  import { defineComponent } from 'vue';

  export default defineComponent({
    directives: {
      overflowTitle,
    },
    setup() {
    },
  });

</script>

overflowTitle 指令属性(计算父元素宽度)

参数说明类型可选值默认值
content文本内容。没有的话去default slotString
--
--
calType计算文本宽度方式,默认通过dom计算机文本宽度,canvas则通过measureText计算String
domcanvas
dom

组件库

整个功能已集中到MagicBox组件库 可以使用组件库:https://bkui-vue.woa.com/overflow-title

Keywords

text-overflow

FAQs

Package last updated on 11 Aug 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts