Skip to content

Commit

Permalink
文本默认值
Browse files Browse the repository at this point in the history
  • Loading branch information
blryli committed Nov 28, 2023
1 parent 1d6b3a5 commit 8a4c584
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dk-vui",
"version": "0.0.32",
"version": "0.0.33",
"description": "dk-vui",
"private": false,
"author": "blryli",
Expand Down
4 changes: 1 addition & 3 deletions packages/Text/src/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,7 @@ const props = defineProps({
const emit = defineEmits(['click'])
const slots = useSlots()
const { children } = slots.default && slots.default()[0] || {}
const nothing = computed(() => slots.default && !children || !props.value && props.value !== 0)
const nothing = computed(() => !slots.default && !props.value && props.value !== 0)
// 溢出
const lineNum = +props.line
Expand Down
2 changes: 1 addition & 1 deletion src/views/components/Text/document.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
| 属性名 | 说明 | 类型 | 默认值 |
| -------- | -------------------------------------------------------------------------------- | ------------- | ------ |
| title | 文本标题,没有则不展示标题 | string/number ||
| value | 文本内容,没有内容则展示'-' | string/number ||
| value | 文本内容,没有内容则展示'-',如果用插槽渲染则需要自己处理默认值 | string/number ||
| line | 文本行数,溢出内容显示... | string/number | 1 |
| copy | 是否启用复制功能 | boolean | false |
| type | 文本类型,默认text,可选 button/link,仅做了样式处理,功能需要监听点击事件去处理 | string | text |
Expand Down

0 comments on commit 8a4c584

Please sign in to comment.