SettingTabs.vue 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <template>
  2. <div class="options-header has-background-black-ter">
  3. <div class="columns is-centered">
  4. <div class="form-column column is-two-thirds-tablet is-half-desktop is-one-third-widescreen is-one-third-fullhd">
  5. <div class="tabs is-centered is-fullwidth">
  6. <ul>
  7. <li v-for="tab in tabs" :key="tab.view" :class="{ 'is-active': tab.view === activeTab }">
  8. <a @click="selectTab(tab.view)">{{ tab.name }}</a>
  9. </li>
  10. </ul>
  11. </div>
  12. </div>
  13. </div>
  14. </div>
  15. </template>
  16. <script>
  17. export default {
  18. name: 'SettingTabs',
  19. data(){
  20. return {
  21. tabs: [
  22. {
  23. 'name' : this.$t('settings.options'),
  24. 'view' : 'settings.options'
  25. },
  26. {
  27. 'name' : this.$t('settings.account'),
  28. 'view' : 'settings.account'
  29. },
  30. {
  31. 'name' : this.$t('settings.oauth'),
  32. 'view' : 'settings.oauth'
  33. },
  34. {
  35. 'name' : this.$t('settings.webauthn'),
  36. 'view' : 'settings.webauthn'
  37. },
  38. ]
  39. }
  40. },
  41. props: {
  42. activeTab: {
  43. type: String,
  44. default: ''
  45. },
  46. },
  47. methods: {
  48. selectTab(viewName) {
  49. this.$router.push({ name: viewName })
  50. },
  51. }
  52. }
  53. </script>