import "./index.less"; import ThemeColor from "./ThemeColor"; import BlockChecbox from "./BlockChecbox"; import Vue from 'vue'; import { Drawer, Modal, Divider, message } from "ant-design-vue"; import { mapGetters } from "vuex"; const Body = { props: ["title"], render: function render() { var h = arguments[0]; const { $slots, title } = this; return h("div", { style: { marginBottom: 24 } }, [ h("h3", { class: "title" }, title), $slots["default"], ]); }, }; Vue.use(Drawer) Vue.use(Modal) const SettingDrawer = { // data: () => ({ // primaryColor: "#42b983", // blockChecbox: "sidemenu" // }), props: ["collapse"], computed: { ...mapGetters({ settings: "global/settings", }), }, methods: { changeSetting(key, value) { const nextState = this.settings; nextState[key] = value; if (key === "layout") { nextState.contentWidth = value === "topmenu" ? "Fixed" : "Fluid"; } else if (key === 'fixedHeader' && !value) { nextState.autoHideHeader = false; } // console.log(this.settings); // console.log(nextState); this.$store.commit('global/UpdateDefaultSettings', this.s) this.$store.commit('global/UpdateDefaultSettings', nextState) console.log(key); console.log(value); message.loading("正在编译主题!", 3); this.$store.dispatch("global/defaultSettings", true); }, togglerContent() { this.$parent.collapse = !this.collapse; }, }, render() { const { collapse } = this; const { primaryColor, layout, navTheme } = this.settings; return (
{ this.changeSetting("navTheme", e); }} /> { this.changeSetting("primaryColor", e); }} /> { this.changeSetting("layout", e); }} />

其它设置

); }, }; export default SettingDrawer;