You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

100 lines
2.5 KiB

5 years ago
  1. <template>
  2. <div class="app-container">
  3. <el-card class="box-card">
  4. <div slot="header">
  5. <a class='link-type link-title' target="_blank" href='https://panjiachen.github.io/vue-element-admin-site/#/theme'>
  6. {{$t('theme.documentation')}}
  7. </a>
  8. </div>
  9. <div class="box-item">
  10. <span class="field-label">{{$t('theme.change')}} : </span>
  11. <el-switch v-model="theme"></el-switch>
  12. <code style="margin-top:15px;">{{$t('theme.tips')}}</code>
  13. </div>
  14. </el-card>
  15. <div class="block">
  16. <el-button type="primary">Primary</el-button>
  17. <el-button type="success">Success</el-button>
  18. <el-button type="info">Info</el-button>
  19. <el-button type="warning">Warning</el-button>
  20. <el-button type="danger">Danger</el-button>
  21. </div>
  22. <div class="block">
  23. <el-button type="primary" icon="el-icon-edit"></el-button>
  24. <el-button type="primary" icon="el-icon-share"></el-button>
  25. <el-button type="primary" icon="el-icon-delete"></el-button>
  26. <el-button type="primary" icon="el-icon-search">Search</el-button>
  27. <el-button type="primary">
  28. Upload
  29. <i class="el-icon-upload el-icon-right"></i>
  30. </el-button>
  31. </div>
  32. <div class="block">
  33. <el-tag class='tag-item' v-for="tag in tags" :type="tag.type" :key='tag.type'>
  34. {{tag.name}}
  35. </el-tag>
  36. </div>
  37. <div class="block">
  38. <el-radio-group v-model="radio">
  39. <el-radio :label="3">Option A</el-radio>
  40. <el-radio :label="6">Option B</el-radio>
  41. <el-radio :label="9">Option C</el-radio>
  42. </el-radio-group>
  43. </div>
  44. <div class="block">
  45. <el-slider v-model="slideValue"></el-slider>
  46. </div>
  47. </div>
  48. </template>
  49. <script>
  50. import { toggleClass } from '@/utils'
  51. import '@/assets/custom-theme/index.css' // the theme changed version element-ui css
  52. export default {
  53. name: 'theme',
  54. data() {
  55. return {
  56. theme: false,
  57. tags: [
  58. { name: 'Tag One', type: '' },
  59. { name: 'Tag Two', type: 'info' },
  60. { name: 'Tag Three', type: 'success' },
  61. { name: 'Tag Four', type: 'warning' },
  62. { name: 'Tag Five', type: 'danger' }
  63. ],
  64. slideValue: 50,
  65. radio: 3
  66. }
  67. },
  68. watch: {
  69. theme() {
  70. toggleClass(document.body, 'custom-theme')
  71. }
  72. }
  73. }
  74. </script>
  75. <style scoped>
  76. .field-label{
  77. vertical-align: middle;
  78. }
  79. .box-card {
  80. width: 400px;
  81. margin: 20px auto;
  82. }
  83. .block {
  84. padding: 30px 24px;
  85. }
  86. .tag-item {
  87. margin-right: 15px;
  88. }
  89. </style>