| | |
| | | <template> |
| | | <div> |
| | | <el-dialog title="选择" |
| | | append-to-body |
| | | :visible.sync="box" |
| | | width="50%"> |
| | | <el-radio-group v-model="text" |
| | | class="list"> |
| | | <el-dialog title="选择" append-to-body :visible.sync="box" width="50%"> |
| | | <el-radio-group v-model="text" class="list"> |
| | | <el-row :span="24"> |
| | | <el-col v-for="(item,index) in list" |
| | | :key="index" |
| | | :md="4" |
| | | :xs="12" |
| | | :sm="4"> |
| | | <el-radio :label="item.value">{{item.name}}</el-radio> |
| | | <el-col |
| | | v-for="(item, index) in list" |
| | | :key="index" |
| | | :md="4" |
| | | :xs="12" |
| | | :sm="4" |
| | | > |
| | | <el-radio :label="item.value">{{ item.name }}</el-radio> |
| | | </el-col> |
| | | </el-row> |
| | | </el-radio-group> |
| | | </el-dialog> |
| | | |
| | | <span> |
| | | <i class="icon-zhuti" |
| | | @click="open"></i> |
| | | <i class="icon-zhuti" @click="open"></i> |
| | | </span> |
| | | </div> |
| | | </template> |
| | |
| | | import { setTheme } from "@/util/util"; |
| | | import { mapGetters } from "vuex"; |
| | | export default { |
| | | data () { |
| | | data() { |
| | | return { |
| | | box: false, |
| | | text: "", |
| | | list: [ |
| | | { |
| | | name: "默认主题", |
| | | value: "default" |
| | | value: "default", |
| | | }, |
| | | { |
| | | name: "白色主题", |
| | | value: "theme-white" |
| | | value: "theme-white", |
| | | }, |
| | | { |
| | | name: "黑色主题", |
| | | value: "theme-dark" |
| | | value: "theme-dark", |
| | | }, |
| | | { |
| | | name: "炫彩主题", |
| | | value: "theme-star" |
| | | value: "theme-star", |
| | | }, |
| | | { |
| | | name: "智能主题", |
| | | value: "theme-bule" |
| | | // value: "theme-bule" |
| | | value: "theme-white", |
| | | }, |
| | | { |
| | | name: "iview主题", |
| | | value: "theme-iview" |
| | | value: "theme-iview", |
| | | }, |
| | | { |
| | | name: "vip主题", |
| | | value: "theme-vip" |
| | | value: "theme-vip", |
| | | }, |
| | | { |
| | | name: "cool主题", |
| | | value: "theme-cool" |
| | | value: "theme-cool", |
| | | }, |
| | | { |
| | | name: "d2主题", |
| | | value: "theme-d2" |
| | | value: "theme-d2", |
| | | }, |
| | | { |
| | | name: "hey主题", |
| | | value: "theme-hey" |
| | | value: "theme-hey", |
| | | }, |
| | | { |
| | | name: "lte主题", |
| | | value: "theme-lte" |
| | | } |
| | | ] |
| | | value: "theme-lte", |
| | | }, |
| | | ], |
| | | }; |
| | | }, |
| | | watch: { |
| | | text: function (val) { |
| | | this.$store.commit("SET_THEME_NAME", val); |
| | | setTheme(val); |
| | | } |
| | | }, |
| | | }, |
| | | computed: { |
| | | ...mapGetters(["themeName"]) |
| | | ...mapGetters(["themeName"]), |
| | | }, |
| | | mounted () { |
| | | mounted() { |
| | | this.text = this.themeName; |
| | | if (!this.text) { |
| | | this.text = ""; |
| | | } |
| | | }, |
| | | methods: { |
| | | open () { |
| | | open() { |
| | | this.box = true; |
| | | } |
| | | } |
| | | }, |
| | | }, |
| | | }; |
| | | </script> |
| | | |