mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-18 08:44:25 +08:00
support click pie chart to change current selected item
This commit is contained in:
@@ -11,7 +11,8 @@
|
|||||||
:stroke="item.color | defaultIconColor('var(--default-icon-color)')"
|
:stroke="item.color | defaultIconColor('var(--default-icon-color)')"
|
||||||
:stroke-width="diameter"
|
:stroke-width="diameter"
|
||||||
:stroke-dasharray="item | itemStrokeDash(circumference)"
|
:stroke-dasharray="item | itemStrokeDash(circumference)"
|
||||||
:stroke-dashoffset="item | itemDashOffset(validItems, circumference, itemCommonDashOffset)">
|
:stroke-dashoffset="item | itemDashOffset(validItems, circumference, itemCommonDashOffset)"
|
||||||
|
@click="switchSelectedIndex(idx)">
|
||||||
</circle>
|
</circle>
|
||||||
|
|
||||||
<circle class="pie-chart-text-background"
|
<circle class="pie-chart-text-background"
|
||||||
@@ -194,6 +195,9 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
switchSelectedIndex: function (index) {
|
||||||
|
this.selectedIndex = index;
|
||||||
|
},
|
||||||
switchSelectedItem: function (offset) {
|
switchSelectedItem: function (offset) {
|
||||||
let newSelectedIndex = this.selectedIndex + offset;
|
let newSelectedIndex = this.selectedIndex + offset;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user