Commit d53f5626 authored by WuFeiyang's avatar WuFeiyang

增加了slideshow

parent bbecfbba
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
<b-form-input v-model="config.data.url"></b-form-input> <b-form-input v-model="config.data.url"></b-form-input>
<b-input-group-append> <b-input-group-append>
<b-button @click="updateUI" text="Button" variant="primary">OK</b-button> <b-button @click="updateUI" text="Button" variant="primary">OK</b-button>
<b-button variant="info" @click="pathPoke">poke</b-button>
</b-input-group-append> </b-input-group-append>
</b-input-group> </b-input-group>
</b-col> </b-col>
...@@ -129,10 +130,12 @@ export default class SlideShow extends Widget { ...@@ -129,10 +130,12 @@ export default class SlideShow extends Widget {
mounted() { mounted() {
this.timer = setInterval(this.showSlide, 100); this.timer = setInterval(this.showSlide, 100);
console.log("this.timermounted"+this.timer);
} }
destroyed() { destroyed() {
clearInterval(this.timer); clearInterval(this.timer);
console.log(this.timer);
} }
turnLastImg() turnLastImg()
...@@ -164,12 +167,17 @@ export default class SlideShow extends Widget { ...@@ -164,12 +167,17 @@ export default class SlideShow extends Widget {
{ {
clearInterval(this.timer); clearInterval(this.timer);
this.isPause = true; this.isPause = true;
console.log("pause"+this.currentImgIndex);
console.log("this.timerdestroy"+this.timer);
} }
playImg() playImg()
{ {
clearInterval(this.timer);
console.log("this.timerplaydestroy"+this.timer);
this.timer = setInterval(this.showSlide, 100); this.timer = setInterval(this.showSlide, 100);
this.isPause = false; this.isPause = false;
console.log("this.timerplay"+this.timer);
} }
updateUI() { updateUI() {
...@@ -271,6 +279,7 @@ export default class SlideShow extends Widget { ...@@ -271,6 +279,7 @@ export default class SlideShow extends Widget {
{ {
(this.$refs.WidgetParams as WidgetParams).setVariableInput(this.userInputData); (this.$refs.WidgetParams as WidgetParams).setVariableInput(this.userInputData);
this.updateUI(); this.updateUI();
this.refresh();
} }
} }
...@@ -282,6 +291,7 @@ export default class SlideShow extends Widget { ...@@ -282,6 +291,7 @@ export default class SlideShow extends Widget {
varTemp = this.currentImgIndex; varTemp = this.currentImgIndex;
varTemp++; varTemp++;
this.currentImgIndex = varTemp % this.img.length; this.currentImgIndex = varTemp % this.img.length;
console.log(this.currentImgIndex);
} }
} }
refresh() { refresh() {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment