From ec3e4b5571e764289dfc654127f5874597d7dbfb Mon Sep 17 00:00:00 2001 From: chenghongxing <1126263215@qq.com> Date: Wed, 26 Aug 2020 18:52:39 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20add=20watch=20method=20for=20i18n=20and?= =?UTF-8?q?=20options=20of=20menu.js;=20:star:=20=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=EF=BC=9A=E4=B8=BA=20menu.js=20=E7=BB=84=E4=BB=B6=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=20i18n=20=E5=92=8C=20options=20=E9=80=89=E9=A1=B9?= =?UTF-8?q?=E7=9A=84=E7=9B=91=E5=90=AC=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/menu/menu.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/components/menu/menu.js b/src/components/menu/menu.js index 9f6dbc2..9e75bd2 100644 --- a/src/components/menu/menu.js +++ b/src/components/menu/menu.js @@ -89,6 +89,19 @@ export default { } }, watch: { + options(val) { + if (!val[0].fullPath) { + this.formatOptions(this.options, '') + } + }, + i18n(val) { + if(val && val.messages) { + const messages = this.i18n.messages + Object.keys(messages).forEach(key => { + this.$i18n.mergeLocaleMessage(key, messages[key]) + }) + } + }, collapsed (val) { if (val) { this.cachedOpenKeys = this.sOpenKeys