Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New line problem #8

Open
mrcode86 opened this issue Mar 19, 2019 · 0 comments
Open

New line problem #8

mrcode86 opened this issue Mar 19, 2019 · 0 comments

Comments

@mrcode86
Copy link

mrcode86 commented Mar 19, 2019

Hi

And thanks for a greate component.

I have this:

               <div class="font-weight-bold">{{ item.user.username }}</div>
               <div class="comment-text">
                    <v-clamp autoresize :max-lines="3">
                        {{ item.text }}
                        <button v-if="expanded || clamped"
                                slot="after"
                                slot-scope="{ toggle, expanded, clamped }"
                                class="comment-toggle"
                                @click="toggle">
                            <template v-if="clamped">
                                {{ $t('ShowMore') }}
                            </template>
                            <template v-if="expanded">
                                {{ $t('ShowLess') }}
                            </template>
                        </button>
                    </v-clamp>
                </div>

And item.text = "Hello\n\nMy name is...\n and i live in..."

The problem is thet all the text is on the same line. Then i try this css:
.comment-text span span { white-space: pre-line; }

Then i first recive a empty line, then i se "Hello" and the third line contains, "... Read more".

How can i craete a new line when the text contains \n? Or remove the first line?

Result:
image

But should be:
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant