Skip to content

Commit

Permalink
修复mobileK线指标线显示隐藏问题
Browse files Browse the repository at this point in the history
  • Loading branch information
zcZhang123 committed May 28, 2019
1 parent b35fe22 commit 376ed23
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
10 changes: 7 additions & 3 deletions src/components/mobileChart.vue
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
v-show="showChart === 'candle'"
v-on:listenToChildEvent="changeCycle"
v-on:listenTipIndex="getTipDataIndex"
v-on:listenMacdChartOpenClose="getMacdOpenClose"
v-on:listenIndicatorChartOpenClose="getIndicatorOpenClose"
:kline-config="klineConfig"
:chart-data-obj="chartDataObj"
></KLine>
Expand Down Expand Up @@ -327,8 +327,12 @@ export default {
}
}
},
getMacdOpenClose(indicator) {
this.showIndicatorChart = indicator;
getIndicatorOpenClose(indicator) {
if (this.showIndicatorChart === indicator) {
this.showIndicatorChart = null;
} else {
this.showIndicatorChart = indicator;
}
},
getTipDataIndex(index) {
if (index) {
Expand Down
16 changes: 10 additions & 6 deletions src/components/mobileKline.vue
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,9 @@
</div>
</div>
<div
@click="openCloseEyes"
:class="this.showIndicator === null ? 'close-eye-icon' : 'open-eye-icon'"
></div>
@click="openCloseEyes"
:class="this.showIndicator === '' ? 'close-eye-icon' : 'open-eye-icon'"
></div>
</div>
<!-- mobile kline -->
<div
Expand Down Expand Up @@ -171,7 +171,7 @@ export default {
selectHour: "",
showIndicatorBtn: true,
showIndicatorDiv: false,
showIndicator: null
showIndicator: ""
};
},
props: {
Expand Down Expand Up @@ -351,9 +351,13 @@ export default {
this.showIndicatorDiv = !this.showIndicatorDiv;
},
showIndicatorChart(indicator) {
this.$emit("listenMacdChartOpenClose", indicator);
this.$emit("listenIndicatorChartOpenClose", indicator);
if (this.showIndicator === indicator) {
this.showIndicator = "";
} else {
this.showIndicator = indicator;
}
this.showIndicatorDiv = false;
this.showIndicator = indicator;
},
openCloseEyes() {
if (this.showIndicator === null) {
Expand Down

0 comments on commit 376ed23

Please sign in to comment.