🔧 build(H5): 解决build H5 端失败的问题
This commit is contained in:
parent
fb589f120f
commit
2bd4d07fbb
11
package.json
11
package.json
@ -39,10 +39,14 @@
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.7.7",
|
||||
"@tarojs/components": "3.5.5",
|
||||
"@tarojs/plugin-framework-react": "^3.4.12",
|
||||
"@tarojs/helper": "^3.5.5",
|
||||
"@tarojs/plugin-framework-react": "^3.5.5",
|
||||
"@tarojs/react": "3.5.5",
|
||||
"@tarojs/router": "^3.5.5",
|
||||
"@tarojs/runtime": "^3.5.5",
|
||||
"@tarojs/shared": "^3.5.5",
|
||||
"@tarojs/taro": "3.5.5",
|
||||
"@tarojs/taro-h5": "^3.5.5",
|
||||
"big.js": "^6.2.1",
|
||||
"dayjs": "^1.11.3",
|
||||
"qs": "^6.10.3",
|
||||
@ -51,13 +55,12 @@
|
||||
"react-redux": "^8.0.1",
|
||||
"redux": "^4.2.0",
|
||||
"redux-logger": "^3.0.6",
|
||||
"redux-thunk": "^2.4.1",
|
||||
"tarojs": "^2.1.1"
|
||||
"redux-thunk": "^2.4.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.8.0",
|
||||
"@pmmmwh/react-refresh-webpack-plugin": "0.5.4",
|
||||
"@tarojs/plugin-mini-ci": "^3.5.1",
|
||||
"@tarojs/cli": "^3.5.5",
|
||||
"@tarojs/plugin-platform-weapp": "^3.5.5",
|
||||
"@tarojs/plugin-react-devtools": "^3.4.13",
|
||||
"@tarojs/webpack5-runner": "^3.5.5",
|
||||
|
13
src/app.tsx
13
src/app.tsx
@ -11,9 +11,9 @@ type ParamsType = {
|
||||
}
|
||||
|
||||
const store = configStore()
|
||||
const App: FC<ParamsType> = (params) => {
|
||||
const App: FC<ParamsType> = params => {
|
||||
const { children } = params
|
||||
|
||||
if (process.env.TARO_ENV === 'weapp') {
|
||||
Taro.showShareMenu({
|
||||
withShareTicket: true,
|
||||
})
|
||||
@ -24,15 +24,15 @@ const App: FC<ParamsType> = (params) => {
|
||||
//检查版本更新
|
||||
onAppShow(() => {
|
||||
const updateManager = Taro.getUpdateManager()
|
||||
updateManager.onCheckForUpdate(function (res) {
|
||||
updateManager.onCheckForUpdate(function(res) {
|
||||
// 请求完新版本信息的回调
|
||||
console.log('版本信息:', res.hasUpdate)
|
||||
})
|
||||
updateManager.onUpdateReady(function () {
|
||||
updateManager.onUpdateReady(function() {
|
||||
Taro.showModal({
|
||||
title: '更新提示',
|
||||
content: '新版本已经准备好,是否重启应用?',
|
||||
success: function (res) {
|
||||
success: function(res) {
|
||||
if (res.confirm) {
|
||||
// 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
|
||||
updateManager.applyUpdate()
|
||||
@ -40,10 +40,11 @@ const App: FC<ParamsType> = (params) => {
|
||||
},
|
||||
})
|
||||
})
|
||||
updateManager.onUpdateFailed(function () {
|
||||
updateManager.onUpdateFailed(function() {
|
||||
console.log('新版本更新失败')
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
return (
|
||||
<ContextBlueTooth>
|
||||
|
Loading…
x
Reference in New Issue
Block a user