| | |
| | | watch: { |
| | | show(value) { |
| | | if (value && !this.clickNotClose) { |
| | | this.addEventClick() |
| | | // 延后到本次点击结束后再监听,避免“点开就被同一次点击关掉” |
| | | this.$nextTick(this.addEventClick) |
| | | } else { |
| | | window.removeEventListener('click', this.closeSidebar) |
| | | } |
| | | if (value) { |
| | | addClass(document.body, 'showRightPanel') |
| | |
| | | }, |
| | | mounted() { |
| | | this.insertToBody() |
| | | this.addEventClick() |
| | | }, |
| | | beforeDestroy() { |
| | | window.removeEventListener('click', this.closeSidebar) |
| | | const elx = this.$refs.rightPanel |
| | | elx.remove() |
| | | }, |
| | | methods: { |
| | | addEventClick() { |
| | | // 先移除再添加,避免重复监听 |
| | | window.removeEventListener('click', this.closeSidebar) |
| | | window.addEventListener('click', this.closeSidebar) |
| | | }, |
| | | closeSidebar(evt) { |
| | |
| | | sideTheme: 'theme-dark', |
| | | |
| | | /** |
| | | * 是否系统布局配置(右下角齿轮面板) |
| | | * 原为 false,导致"主题颜色 / 预设皮肤"入口对用户不可见 → 改为 true |
| | | * 主题风格设置面板是否展开(RightPanel 的 show 状态) |
| | | * 默认关闭,避免进入系统就弹出设置面板; |
| | | * 入口仍保留:右上角头像菜单 → “布局设置” |
| | | */ |
| | | showSettings: true, |
| | | showSettings: false, |
| | | |
| | | /** |
| | | * 是否显示顶部导航 |