Skip to content

Commit 762e440

Browse files
Add 'wordBreak' option to prevent cutting words
1 parent 26c0419 commit 762e440

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ const truncateText = function(el, bindings, useFallbackFunc) {
3939
const VueLineClamp = {
4040
install(Vue, options) {
4141
options = Object.assign(
42-
{ importCss: false, textOverflow: 'ellipsis' },
42+
{ importCss: false, textOverflow: 'ellipsis', wordBreak: true },
4343
options
4444
);
4545

@@ -48,7 +48,7 @@ const VueLineClamp = {
4848
display: -webkit-box;
4949
-webkit-box-orient: vertical;
5050
overflow: hidden;
51-
word-break: break-all;
51+
${options.wordBreak ? 'word-break: break-all;' : ''};
5252
text-overflow: ${options.textOverflow};
5353
`;
5454

0 commit comments

Comments
 (0)