From dad1cf7545cf8de8317cdc35a94b1dfc4cb8de1f Mon Sep 17 00:00:00 2001 From: Sergey Solodyagin Date: Wed, 27 Oct 2021 16:37:56 +0300 Subject: [PATCH] feat: row label style --- README.md | 4 ++++ lib/components/GGanttRow.vue | 4 +++- src/App.vue | 4 ++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 3a19e25..8ad5882 100644 --- a/README.md +++ b/README.md @@ -48,6 +48,7 @@ The following code showcases a simple usage example in a .vue SFC (Single File C v-for="row in rows" :key="row.label" :label="row.label" + :label-style="row.labelStyle" :bars="row.bars" bar-start="myStart" bar-end="myEnd" @@ -76,6 +77,9 @@ The following code showcases a simple usage example in a .vue SFC (Single File C rows: [ { label: "My row #1", + labelStyle: { + justifyContent: "end" + }, bars: [ { myStart: "2020-03-01 12:10", diff --git a/lib/components/GGanttRow.vue b/lib/components/GGanttRow.vue index 19f392f..dc8e0a8 100644 --- a/lib/components/GGanttRow.vue +++ b/lib/components/GGanttRow.vue @@ -49,6 +49,7 @@ export default { props: { label: { type: String, default: 'Row' }, + labelStyle: { type: Object }, bars: { type: Array, default: () => [] }, highlightOnHover: { type: Boolean } }, @@ -107,7 +108,8 @@ export default { background: this.themeColors.ternary, color: this.themeColors.text, borderTop: `1px solid ${this.themeColors.rowLabelBorder}`, - borderBottom: `1px solid ${this.themeColors.rowLabelBorder}` + borderBottom: `1px solid ${this.themeColors.rowLabelBorder}`, + ...this.labelStyle } } }, diff --git a/src/App.vue b/src/App.vue index 0600c89..fd14f61 100644 --- a/src/App.vue +++ b/src/App.vue @@ -25,6 +25,7 @@ v-for="row in chart1.rows" :key="row.label" :label="row.label" + :label-style="row.labelStyle" :bars="row.bars" :highlight-on-hover="chart1.highlightOnHover" > @@ -117,6 +118,9 @@ export default { }, { label: 'Row #2', + labelStyle: { + justifyContent: 'end' + }, bars: [ { myStart: '2020-03-02 09:00',