class="tab-title"
v-on:click="tab"
v-for="(tabTitle,index) in tabTitleList"
:id="index"
I found this example in an vue community, but in my situation, I want my "id" has a prefix, not just a number.
That is to say, if the index is 1, I want <span id='sp_1'></span>
instead of <span id='1'></span>
.
Vuex is a state management pattern for vue. js. $t is the injected method from vue. js or Vue.
A digital ID is a safe way to prove your age and identity using your phone – online and in person. It takes just minutes to create and then you're set up for life. You can now use Yoti, a free to use app to obtain a Digital ID to prove your age at Vue Cinemas across the UK & Ireland.
Using the v-if , v-else , and v-else-if Directives. Vue. js comes pre-packaged with a number of directives that developers commonly use when working within the framework. Directives such as v-if , v-show , v-on , v-model , v-bind , v-html , and more are all provided for you out-of-the-box.
if you define global variable then you can easily access global variable in vuejs app. We will define global variables using vue js mixin. using mixin we will declare all variables in data method. then we will use in our app vue object.
You can just do, code should be self explanatory:
<div v-for="(tabTitle, index) in tabTitleList">
<span :id="'sp_' + index"> {{tabTitle}} </span>
</div>
Documentation link.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With