forked from tusen-ai/naive-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(ellpisis): doesn't work after content is updated, closes tusen-ai…
- Loading branch information
Showing
6 changed files
with
84 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# Dynamic Debug | ||
|
||
```html | ||
<p>测试::::</p> | ||
|
||
<n-ellipsis style="max-width: 240px"> {{ text }} </n-ellipsis> | ||
<br /> | ||
<br /> | ||
<br /> | ||
<n-button type="primary" @click="toogleText">测试动态文字</n-button> | ||
``` | ||
|
||
```js | ||
import { defineComponent, ref } from 'vue' | ||
|
||
export default defineComponent({ | ||
setup () { | ||
const text = ref( | ||
'住在我心里孤独的 孤独的海怪 痛苦之王 开始厌倦 深海的光 停滞的海浪' | ||
) | ||
|
||
const toogleText = () => { | ||
if (text.value.length > 10) { | ||
text.value = '住在我心里孤独的' | ||
} else { | ||
text.value = | ||
'住在我心里孤独的 孤独的海怪 痛苦之王 开始厌倦 深海的光 停滞的海浪' | ||
} | ||
} | ||
|
||
return { | ||
text, | ||
toogleText | ||
} | ||
} | ||
}) | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,7 @@ basic | |
line-clamp | ||
expand-trigger | ||
custom-tooltip | ||
dynamic-debug | ||
``` | ||
|
||
## Props | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters