Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: #8292 (QBadge) add round prop #8370

Merged
merged 8 commits into from
Jan 24, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 7 additions & 0 deletions docs/src/examples/QBadge/Round.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<template>
<div class="q-pa-md q-gutter-md">
<q-badge rounded color="red" label="1" />
<q-badge rounded color="primary" label="999+" />
<q-badge rounded color="orange" label="Round" />
</div>
</template>
2 changes: 2 additions & 0 deletions docs/src/pages/vue-components/badge.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,7 @@ The QBadge component allows you to create a small badge for adding information l

<doc-example title="Outline design" file="QBadge/Outline" />

<doc-example title="Rounded" file="QBadge/Round" />

## QBadge API
<doc-api file="QBadge" />
7 changes: 7 additions & 0 deletions ui/dev/src/pages/components/badge.vue
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,13 @@
v1.0.0
</q-badge>
</div>

<div>
Some text <q-badge color="red" label="1" rounded />
</div>
<div>
Some text <q-badge color="green" label="999+" rounded />
</div>
</div>
</div>
</template>
Expand Down
2 changes: 2 additions & 0 deletions ui/src/components/badge/QBadge.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export default Vue.extend({
transparent: Boolean,
multiLine: Boolean,
outline: Boolean,
rounded: Boolean,

label: [Number, String],

Expand Down Expand Up @@ -46,6 +47,7 @@ export default Vue.extend({
) +
(text !== void 0 ? ` text-${text}` : '') +
(this.floating === true ? ' q-badge--floating' : '') +
(this.rounded === true ? ' q-badge--rounded' : '') +
(this.transparent === true ? ' q-badge--transparent' : '')
},

Expand Down
7 changes: 7 additions & 0 deletions ui/src/components/badge/QBadge.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,13 @@
"desc": "Use 'outline' design (colored text and borders only)",
"category": "content",
"addedIn": "v1.4.5"
},

"rounded": {
"type": "Boolean",
"desc": "Makes a rounded shaped badge",
"category": "style",
"addedIn": "v1.15.2"
}
},

Expand Down
3 changes: 3 additions & 0 deletions ui/src/components/badge/QBadge.sass
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,6 @@
&--outline
background-color: transparent
border: 1px solid currentColor

&--rounded
border-radius: 1em
3 changes: 3 additions & 0 deletions ui/src/components/badge/QBadge.styl
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,6 @@
&--outline
background-color: transparent
border: 1px solid currentColor

&--rounded
border-radius: 1em