Justineo / vue-clamp

Clamping multiline text with ease.
https://vue-clamp.vercel.app
MIT License
697 stars 89 forks source link

Added ability to specify ellipsis location (start, middle, end) #66

Closed jibsaramnim closed 3 years ago

jibsaramnim commented 3 years ago

This PR adds a new property that lets you specify where you would like to have the ellipsis be shown. By default this appears at the end, but now you can also choose start and middle. The latter splits the text in half*, placing the ellipsis right in the middle.

I must apologize in advance as I do not speak Chinese, so I was not able to provide translations for the added content on the demo page. It would be great if you could take a look at this and, if it looks alright to you too, merge this. I have tried to make sure I followed your existing formatting, but please let me know if I made any mistakes, or missed any details.

Thank you!

* Using Math.floor on the left-hand side, and Math.ceil on the right-hand side, to support uneven string lengths too.

vercel[bot] commented 3 years ago

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/justineo/vue-clamp/FJMQXvkxKkj1DXL8AgZaJVaXhgWr
✅ Preview: https://vue-clamp-git-fork-jibsaramnim-master-justineo.vercel.app

jibsaramnim commented 3 years ago

@Justineo thank you kindly for taking a look! I have applied the changes you have suggested, including removing the compiled demo files and adding that folder to .gitignore. Please let me know if there is anything else you'd like me to do, I'm more than happy to help! :)

Justineo commented 3 years ago

Thank you!

jibsaramnim commented 3 years ago

@Justineo just a small note; it might be useful to update the Github repo demo URL, as it's still pointing to https://justineo.github.io/vue-clamp/demo/ which isn't working anymore now.

Justineo commented 3 years ago

@jibsaramnim Oops I forgot about that. Fixed now, thank you!