From dcc8e47656c2dc98fe4c51fe45de25b932b5cf67 Mon Sep 17 00:00:00 2001 From: Luk Lu Date: Thu, 4 Jun 2020 15:25:50 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=20setBarTitles=20=E6=96=B9?= =?UTF-8?q?=E6=B3=95=EF=BC=8C=E9=9B=86=E4=B8=AD=E8=AE=BE=E7=BD=AE=E6=B5=8F?= =?UTF-8?q?=E8=A7=88=E5=99=A8=E7=AA=97=E5=8F=A3=E6=A0=87=E9=A2=98+?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E5=AF=BC=E8=88=AA=E6=A0=8F=E6=A0=87=E9=A2=98?= =?UTF-8?q?+=E9=A1=B5=E9=9D=A2=E6=A0=87=E7=AD=BE=E6=A0=8F=E6=A0=87?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/index.js b/index.js index b4f328d..f5ace07 100644 --- a/index.js +++ b/index.js @@ -95,6 +95,14 @@ module.exports = { } }, + setBarTitles({windowTitle, pageTitle}={}){ + uni.setNavigationBarTitle({ title: pageTitle || this.localeText.tPageTitle }) + // #ifdef H5 + document.title = windowTitle || this.appName || this.$store.getters['i18n/getAppName'] // 必须放在 setNavigationBarTitle 之后,否则会被其覆盖掉。 + // #endif + this.$store.commit('i18n/setTabbar') // 必须要在有 tab 的页面里重置才能成功 + }, + formatMoney(value, decimal){ return Number(value).toFixed(decimal||2) },