forked from quasarframework/quasar
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathQCard.js
More file actions
38 lines (29 loc) · 980 Bytes
/
QCard.js
File metadata and controls
38 lines (29 loc) · 980 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import { h, computed, getCurrentInstance } from 'vue'
import useDark, { useDarkProps } from '../../composables/private/use-dark.js'
import { createComponent } from '../../utils/private/create.js'
import { hSlot } from '../../utils/private/render.js'
export default createComponent({
name: 'QCard',
props: {
...useDarkProps,
tag: {
type: String,
default: 'div'
},
square: Boolean,
flat: Boolean,
bordered: Boolean
},
setup (props, { slots }) {
const vm = getCurrentInstance()
const isDark = useDark(props, vm.proxy.$q)
const classes = computed(() =>
'q-card'
+ (isDark.value === true ? ' q-card--dark q-dark' : '')
+ (props.bordered === true ? ' q-card--bordered' : '')
+ (props.square === true ? ' q-card--square no-border-radius' : '')
+ (props.flat === true ? ' q-card--flat no-shadow' : '')
)
return () => h(props.tag, { class: classes.value }, hSlot(slots.default))
}
})