react-line-clamp
Advanced tools
Comparing version 1.0.0 to 1.0.1
{ | ||
"name": "react-line-clamp", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "A react component which can help you implememt line-clamp automatically", | ||
@@ -5,0 +5,0 @@ "main": "LineClamp.js", |
@@ -61,8 +61,7 @@ # [react-clamp](https://github.com/oglen/react-clamp) | ||
npm instasll | ||
npm instasll | ||
gulp | ||
gulp | ||
And visit link: | ||
/demo/index.html | ||
/demo/index.html |
import React from 'react'; | ||
import { render } from 'react-dom'; | ||
import random from 'lodash/random'; | ||
import LineClamp from '../lib/LineClamp'; | ||
import debounce from 'lodash/debounce'; | ||
import Clamp from '../lib/Clamp'; | ||
@@ -13,7 +14,7 @@ class App extends React.Component { | ||
componentDidMount() { | ||
window && window.addEventListener('resize', event => { | ||
window && window.addEventListener('resize', debounce(event => { | ||
this.refs.aCard.adjustContext(); | ||
this.refs.bCard.adjustContext(); | ||
this.refs.cCard.adjustContext(); | ||
}); | ||
}, 300)); | ||
} | ||
@@ -25,15 +26,15 @@ | ||
<div className="column"> | ||
<LineClamp className="card" ellipsis="..." ref="aCard"> | ||
<Clamp className="card" ellipsis="..." ref="aCard"> | ||
Some of Australia’s largest waterfront office buildings are changing hands, with Melbourne’s South Wharf Tower up for sale and a Brisbane building fetching one of the highest prices for an office complex in the past | ||
</LineClamp> | ||
</Clamp> | ||
</div> | ||
<div className="column"> | ||
<LineClamp className="card" ellipsis={<span> <a href="#">Read More</a></span>} ref="bCard"> | ||
<Clamp className="card" ellipsis={<span> <a href="#">Read More</a></span>} ref="bCard"> | ||
Brisbane’s Waterfront Place and the Eagle Street Pier retail complex were snapped up by property giant Dexus Property Group and Dexus Wholesale Property Fund for a staggering $635 million. | ||
</LineClamp> | ||
</Clamp> | ||
</div> | ||
<div className="column"> | ||
<LineClamp className="card" ellipsis=">" ref="cCard"> | ||
<Clamp className="card" ellipsis=">" ref="cCard"> | ||
“Waterfront Place complements our ownership of 480 Queen Street in Brisbane and reinforces our role as a workspace partner for our customers.” | ||
</LineClamp> | ||
</Clamp> | ||
</div> | ||
@@ -40,0 +41,0 @@ </div> |
16260
286
67