Open helsonxiao opened 3 years ago
I think decoupling the measure process implementation with Vue is a good idea. Some thoughts:
Raw HTML support is fancy but I don't think it can cover tag clamping usage (or something with fixed height).
I've searched numLines++
in text-clipper
repo. From what I see, numLines
only increases if there is any character/tagName in whitelist(block level tag, <br />
, \n
, ...).
Anyway, thanks for your advises! I'll wait for raw html support currently.
I don't think it can cover tag clamping usage
Yes. That's why I said we need to discuss more to figure out what the final API should look like and what feature set should be supported.
maxLines
in text-clipper
is totally different from maxLines
in vue-clamp
. Maybe both of them can be provided. Tags clamping needs an extra lineHeight
, but it still insists the rule(A real line! hhh).
Honestly, I have no idea. Waiting for a solution.
This repo is so great. Thanks to your work! We found it because there is a tags-clamping feature in our product. Since we haven't found any vue component supports tags-clamping, we reimplemented
vue-clamp
. I hope our codes could be merged into master branch so I submit this issue.Let me explain the main changes:
applyChange
method, we only need to design a proper workflow in Vue style for offset updating. Then just let Vue handle the DOM updating!ant-design
inutils.js
.Fork repo: https://github.com/boyuai/vue-clamp Demo: https://boyuai.github.io/vue-clamp/demo/