Justineo / vue-clamp

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

Change text in button when expanded #19

Closed mituller closed 5 years ago

mituller commented 5 years ago

Is there a way to change the text of the button that expands the text so that it could read something like Read More and then Read Less when expanded?

danielschwab commented 5 years ago
<v-clamp autoresize :max-lines="1">
    {{ text }}
    <button
            v-if="expanded || clamped"
            slot="after"
            slot-scope="{ toggle, expanded, clamped }"
            @click="toggle"
    >
        {{ expanded ? 'Read Less' : 'Read More' }}
    </button>
</v-clamp>
mituller commented 5 years ago

Thank you.