Skip to content

How to programmatically enable the clamping of lines when it reaches the maximum amount of lines #34

@justlester

Description

@justlester

Hi! I just want to ask how to know if the content reaches the maximum line being set.
Let say for example I set the maximum to 5 lines and the text content has only 1 line. I wanted to enable clamping if it reaches more than 5 lines.

The content can be html or text.

  <div v-line-clamp="clampLines" style="word-break:normal!important;">
                        <span v-html="text"></span>
                    </div>
                    <v-divider v-if="clampLines"></v-divider>
                    <v-btn @click="toggleLines" text small block color="primary" class="font-weight-bold">
                        <template v-if="clampLines">Read More</template>
                        <template v-if="!clampLines">Read Less</template>
                    </v-btn>

a little help would be appreciated. Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions