generated from staticwebdev/vue-basic
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add button section and editable expansion panel header.
- Loading branch information
1 parent
94c657e
commit 25f1405
Showing
3 changed files
with
60 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<template> | ||
<v-btn small right :icon="$attrs.text === undefined" :color="$attrs.color || 'primary'" v-bind="$attrs" | ||
v-on="$listeners"> | ||
<slot></slot> | ||
</v-btn> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<template> | ||
<v-expansion-panel-header class="panel-header" v-bind="$attrs" v-on="$listeners"> | ||
<template v-slot:default="{ open }"> | ||
<v-row no-gutters> | ||
<v-col cols="9"> | ||
<slot></slot> | ||
</v-col> | ||
<v-col cols="3" class="text--secondary pr-3 text-right"> | ||
|
||
<v-fade-transition v-if="canEdit"> | ||
<v-icon color="primary" v-if="open" @click.stop="editClicked()">mdi-pencil-outline</v-icon> | ||
</v-fade-transition> | ||
|
||
<div class="ml-3 d-inline panel-error-count" v-if="errorCount"> | ||
<v-avatar color="error lighten-1" size="22" class="error-count"> | ||
<span class="white--text text-caption">{{ errorCount }}</span> | ||
</v-avatar> | ||
</div> | ||
</v-col> | ||
</v-row> | ||
</template> | ||
</v-expansion-panel-header> | ||
</template> | ||
<script> | ||
export default { | ||
props: { | ||
canEdit: { | ||
type: Boolean, | ||
default: false, | ||
}, | ||
errorCount: { | ||
type: Number, | ||
default: 0, | ||
}, | ||
}, | ||
methods: { | ||
editClicked: function () { | ||
this.$emit("editClicked"); | ||
} | ||
} | ||
}; | ||
</script> | ||
<style scoped> | ||
.error-count { | ||
margin: -6px 0 -2px; | ||
vertical-align: text-bottom; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters