diff --git a/pages/news/index.vue b/pages/news/index.vue index d2fc1e3..fb5fa09 100644 --- a/pages/news/index.vue +++ b/pages/news/index.vue @@ -2,9 +2,14 @@ - - {{ title }}  - + + {{ title }}  + + + + + + @@ -161,8 +166,8 @@ export default { methods: { isTodayDate, navBack() { - this.$modal.showToast('模块建设中~') - console.log('返回上一页') + this.showDrawer('showLeft'); + console.log('点击消息中心') }, clearUnread() { this.$modal.showToast('模块建设中~') @@ -195,6 +200,19 @@ export default { deleteItem(event, index) { this.$modal.showToast('敬请期待~') console.log('删除消息:', event, index) + }, + // 打开窗口 + showDrawer(e) { + this.$refs[e].open() + }, + // 关闭窗口 + closeDrawer(e) { + this.$refs[e].close() + }, + // 抽屉状态发生变化触发 + change(e, type) { + console.log((type === 'showLeft' ? '左窗口' : '右窗口') + (e ? '打开' : '关闭')); + this[type] = e } } }