Rap 原分销系统代码Web
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.

fd41068935069f7659b4b40f45291dc9cb57bb73.svn-base 1.3KB

преди 5 месеца
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <template>
  2. <el-dropdown trigger="click" @command="handleSetSize">
  3. <div>
  4. <svg-icon class-name="size-icon" icon-class="size" />
  5. </div>
  6. <el-dropdown-menu slot="dropdown">
  7. <el-dropdown-item v-for="item of sizeOptions" :key="item.value" :disabled="size===item.value" :command="item.value">
  8. {{
  9. item.label }}
  10. </el-dropdown-item>
  11. </el-dropdown-menu>
  12. </el-dropdown>
  13. </template>
  14. <script>
  15. export default {
  16. data() {
  17. return {
  18. sizeOptions: [
  19. { label: 'Default', value: 'default' },
  20. { label: 'Medium', value: 'medium' },
  21. { label: 'Small', value: 'small' },
  22. { label: 'Mini', value: 'mini' }
  23. ]
  24. }
  25. },
  26. computed: {
  27. size() {
  28. return this.$store.getters.size
  29. }
  30. },
  31. methods: {
  32. handleSetSize(size) {
  33. this.$ELEMENT.size = size
  34. this.$store.dispatch('app/setSize', size)
  35. this.refreshView()
  36. this.$message({
  37. message: '布局设置成功',
  38. type: 'success'
  39. })
  40. },
  41. refreshView() {
  42. // In order to make the cached page re-rendered
  43. this.$store.dispatch('tagsView/delAllCachedViews', this.$route)
  44. const { fullPath } = this.$route
  45. this.$nextTick(() => {
  46. this.$router.replace({
  47. path: '/redirect' + fullPath
  48. })
  49. })
  50. }
  51. }
  52. }
  53. </script>