Skip to content

Commit

Permalink
feat: 完善cell组件 to 属性
Browse files Browse the repository at this point in the history
  • Loading branch information
dahai committed Apr 13, 2024
1 parent 0dd5905 commit f31326a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions docs/components/basic/cell.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@
| desc | 右侧描述 | string | - |
| desc-text-align | 右侧描述文本对齐方式 [text-align](https://www.w3school.com.cn/cssref/pr_text_text-align.asp) | string | `right` |
| is-link | 是否展示右侧箭头并开启点击反馈 | boolean | `false` |
| to | 跳转地址 | string | - |
| round-radius | 圆角半径 | number | `6px` |
| center | 是否使内容垂直居中 | boolean | `false` |
| size | 单元格大小,可选值为 `large` | string | - |
Expand Down
3 changes: 3 additions & 0 deletions example/src/auto-imports.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ declare global {
const useCssModule: typeof import('vue')['useCssModule']
const useCssVars: typeof import('vue')['useCssVars']
const useSlots: typeof import('vue')['useSlots']
const useToast: typeof import('nutui-uniapp/composables')['useToast']
const watch: typeof import('vue')['watch']
const watchEffect: typeof import('vue')['watchEffect']
const watchPostEffect: typeof import('vue')['watchPostEffect']
Expand Down Expand Up @@ -188,6 +189,7 @@ declare module 'vue' {
readonly useCssModule: UnwrapRef<typeof import('vue')['useCssModule']>
readonly useCssVars: UnwrapRef<typeof import('vue')['useCssVars']>
readonly useSlots: UnwrapRef<typeof import('vue')['useSlots']>
readonly useToast: UnwrapRef<typeof import('nutui-uniapp/composables')['useToast']>
readonly watch: UnwrapRef<typeof import('vue')['watch']>
readonly watchEffect: UnwrapRef<typeof import('vue')['watchEffect']>
readonly watchPostEffect: UnwrapRef<typeof import('vue')['watchPostEffect']>
Expand Down Expand Up @@ -280,6 +282,7 @@ declare module '@vue/runtime-core' {
readonly useCssModule: UnwrapRef<typeof import('vue')['useCssModule']>
readonly useCssVars: UnwrapRef<typeof import('vue')['useCssVars']>
readonly useSlots: UnwrapRef<typeof import('vue')['useSlots']>
readonly useToast: UnwrapRef<typeof import('nutui-uniapp/composables')['useToast']>
readonly watch: UnwrapRef<typeof import('vue')['watch']>
readonly watchEffect: UnwrapRef<typeof import('vue')['watchEffect']>
readonly watchPostEffect: UnwrapRef<typeof import('vue')['watchPostEffect']>
Expand Down
6 changes: 5 additions & 1 deletion packages/nutui/components/cell/cell.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@ const getStyle = computed(() => {
})
function handleClick(event: Event) {
emits(CLICK_EVENT, event)
const url = props.to
if (props.isLink)
emits(CLICK_EVENT, event)
if (url && props.isLink)
uni.navigateTo({ url })
}
</script>

Expand Down

0 comments on commit f31326a

Please sign in to comment.