🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

phone-more

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

phone-more

a vuejs component for expand or collapse more text

latest
Source
npmnpm
Version
1.0.8-0
Version published
Weekly downloads
15
150%
Maintainers
1
Weekly downloads
 
Created
Source

phone-more 组件

基于vue2.0的【展开、收起】组件 为了更好的实现多文本能够按指定行数显示,并通过配置两个按钮进行展开与折叠。

效果

安装

npm install -D phone-more

使用

import More from 'phone-more'
Vue.component(More.name, More)

参数说明

  • text

String ,待显示的文本

  • line

显示的行数,默认为2

  • showButton

是否显示组件内置按钮。默认为true

  • expandText

展开按钮的文案

  • collapseText

收起按钮的文案

  • ellipsis

自定义省略符号,默认为...

<div>
  <h6>采用组件默认按钮</h6>
  <ph-more  ref="moreDemo" :text="text" :line="2">
  </ph-more>
</div>
<div>
  <h6>自定义按钮文字</h6>
  <ph-more ref="noButton" expand-text='哈哈'   :text="text" :line="2">
  </ph-more>
</div>
<div>
  <h6>在组件外部定义按钮</h6>
  <ph-more ref="noButton"   :show-button="false" :text="text" :line="2">
  </ph-more>
  <button class="outer-button" @click="expand">{{btnTxt}}</button>
</div>
<div>
  <h6>自定义省略符</h6>
  <ph-more  ref="moreDemo" :ellipsis="'。。。'" :text="text" :line="2">
  </ph-more>
</div>
<div>
  <h6>不带省略符</h6>
  <ph-more  ref="moreDemo" :ellipsis="''" :text="text" :line="2">
  </ph-more>
</div>

Keywords

vuejs

FAQs

Package last updated on 22 Jun 2017

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