forked from quasarframework/quasar
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCardTitle.vue
More file actions
56 lines (48 loc) · 1.06 KB
/
CardTitle.vue
File metadata and controls
56 lines (48 loc) · 1.06 KB
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<template lang="pug">
section.q-my-xs.q-mr-sm.cursor-pointer.text-subtitle1(:id="id", @click="onClick")
div.doc-card-title {{ title }}
</template>
<script>
import { computed } from 'vue'
import { copyHeading, slugify } from 'assets/page-utils'
export default {
name: 'DocHeading',
props: {
title: String,
slugifiedTitle: String,
prefix: String
},
setup (props) {
const id = computed(() =>
(props.prefix || '') +
(props.slugifiedTitle !== void 0 ? props.slugifiedTitle : slugify(props.title))
)
return {
id,
onClick () {
copyHeading(id.value)
}
}
}
}
</script>
<style lang="sass">
$title-color: $grey-4
.doc-card-title
margin-left: -24px
padding: 2px 10px 2px 24px
background: $title-color
color: $grey-8
position: relative
border-radius: 3px 5px 5px 0
&:after
content: ''
position: absolute
top: 100%
left: 0
width: 0
height: 0
border: 0 solid transparent
border-top-color: scale-color($title-color, $lightness: -15%)
border-width: 9px 0 0 11px
</style>