Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <div class="tab"
- v-for="tab in tabItems"
- v-on:click="updateSelected(tab)"
- v-bind:class="{ 'tab-active': selectedTab == tab.index }">
- {{ tab.tabTitle }}
- </div>
- <span v-for="tab in tabItems" v-show="selectedTab == tab.index">{{ tab.tabPrice2 }}</span>
- <script>
- data() {
- return {
- selectedTab: 1,
- tabItems: [
- { index: 1, tabTitle: "План на месяц", tabPrice2: "500", tabPrice3: "500", tabPrice3Yearly: "2 500" },
- { index: 2, tabTitle: "На год", tabPrice2: "400", tabPrice3: "500", tabPrice3Yearly: "2 000" }
- ]
- }
- },
- methods: {
- updateSelected: function(tab) {
- this.selectedTab = tab.index;
- }
- }
- </script>
Add Comment
Please, Sign In to add comment