/
home
/
henzagold
/
oldsite
/
components
/
File Upload :
llllll
Current File: /home/henzagold/oldsite/components/RandomText.vue
<template> <div class="top-header bg-primary text-white"> <div class="flex justify-between px-2 items-center" > <!-- <span>مثقال طلا : {{goldPrice.mesghal.p | tomanPriceUnit }}</span>--> <span>گرم طلای 18 عیار : {{ goldPrice.geram18.p | tomanPriceUnit }}</span> <span class="xl:inline lg:inline hidden"> {{randomText}}</span> <span>{{goldPrice.geram18.uaj }}</span> <!-- <div class="flex justify-center "> {{randomText}} </div>--> </div> </div> </template> <script> export default { name: "RandomText", data(){ return { randomText: '', randomTextIndex: 0, } }, methods:{ setRandomText(){ setTimeout(() => { if (this.randomTextIndex < this.$store.state.header_texts.length-1) ++this.randomTextIndex else this.randomTextIndex = 0 this.randomText = this.$store.state.header_texts[this.randomTextIndex] this.setRandomText() }, 5000) }, }, computed: { brands(){ return this.$store.state.config.brands; }, goldPrice(){ return this.$store.state.config.price; } }, async mounted() { // random text this.randomText = this.$store.state.header_texts[0] this.setRandomText() } } </script> <style scoped> </style>
Copyright ©2k19 -
Hexid
|
Tex7ure