Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
uni-app
提交
2abdf026
U
uni-app
项目概览
DCloud
/
uni-app
3 个月 前同步成功
通知
725
Star
38705
Fork
3642
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
7
列表
看板
标记
里程碑
合并请求
1
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
uni-app
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
7
Issue
7
列表
看板
标记
里程碑
合并请求
1
合并请求
1
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
2abdf026
编写于
5月 11, 2021
作者:
fxy060608
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(h5): router
上级
08563021
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
31 addition
and
20 deletion
+31
-20
packages/playground/ssr/yarn.lock
packages/playground/ssr/yarn.lock
+8
-8
packages/uni-h5-vue/dist/vue.runtime.cjs.js
packages/uni-h5-vue/dist/vue.runtime.cjs.js
+2
-0
packages/uni-h5-vue/dist/vue.runtime.esm.js
packages/uni-h5-vue/dist/vue.runtime.esm.js
+1
-1
packages/uni-h5/dist/uni-h5.cjs.js
packages/uni-h5/dist/uni-h5.cjs.js
+5
-1
packages/uni-h5/dist/uni-h5.es.js
packages/uni-h5/dist/uni-h5.es.js
+5
-1
packages/uni-h5/src/framework/plugin/router.ts
packages/uni-h5/src/framework/plugin/router.ts
+7
-3
packages/vite-plugin-uni/src/config/build.ts
packages/vite-plugin-uni/src/config/build.ts
+2
-4
packages/vite-plugin-uni/src/config/index.ts
packages/vite-plugin-uni/src/config/index.ts
+1
-2
未找到文件。
packages/playground/ssr/yarn.lock
浏览文件 @
2abdf026
...
...
@@ -863,10 +863,10 @@ end-of-stream@^1.1.0:
dependencies:
once "^1.4.0"
esbuild@^0.
9.3
:
version "0.
9.7
"
resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.
9.7.tgz#ea0d639cbe4b88ec25fbed4d6ff00c8d788ef70b
"
integrity sha512-
VtUf6aQ89VTmMLKrWHYG50uByMF4JQlVysb8dmg6cOgW8JnFCipmz7p+HNBl+RR3LLCuBxFGVauAe2wfnF9bLg
==
esbuild@^0.
11.19
:
version "0.
11.20
"
resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.
11.20.tgz#7cefa1aee8b372c184e42457885f7ce5d3e62a1e
"
integrity sha512-
QOZrVpN/Yz74xfat0H6euSgn3RnwLevY1mJTEXneukz1ln9qB+ieaerRMzSeETpz/UJWsBMzRVR/andBht5WKw
==
escalade@^3.1.1:
version "3.1.1"
...
...
@@ -2450,11 +2450,11 @@ verror@1.10.0:
extsprintf "^1.2.0"
vite@^2.2.3:
version "2.
2.4
"
resolved "https://registry.yarnpkg.com/vite/-/vite-2.
2.4.tgz#8f9cc85aacab04c850085894b086c8717f12ed16
"
integrity sha512-
vnIwSNci+phFMp6krhy+FbYzKL0R67Sdt9mVZ96S27AewrApSJjTqncJcalk8sf60BgcbW4+1C6DFIWkxquO9g
==
version "2.
3.0
"
resolved "https://registry.yarnpkg.com/vite/-/vite-2.
3.0.tgz#02b007c7aa4ac88cc18f854b9c68e4fbe76e3ef4
"
integrity sha512-
gsCy0t3X9nGGYDoNiE2NJgYq6BPxrtKeo6FkpMXdMvtUluYxnRhl7xfpHaYDmQLCnMbYTWhvWS1L/Hpw/V9L5w
==
dependencies:
esbuild "^0.
9.3
"
esbuild "^0.
11.19
"
postcss "^8.2.1"
resolve "^1.19.0"
rollup "^2.38.5"
...
...
packages/uni-h5-vue/dist/vue.runtime.cjs.js
浏览文件 @
2abdf026
...
...
@@ -9884,6 +9884,8 @@ exports.markRaw = markRaw;
exports
.
mergeProps
=
mergeProps
;
exports
.
nextTick
=
nextTick
;
exports
.
onActivated
=
onActivated
;
exports
.
onBeforeActivate
=
onBeforeActivate
;
exports
.
onBeforeDeactivate
=
onBeforeDeactivate
;
exports
.
onBeforeMount
=
onBeforeMount
;
exports
.
onBeforeUnmount
=
onBeforeUnmount
;
exports
.
onBeforeUpdate
=
onBeforeUpdate
;
...
...
packages/uni-h5-vue/dist/vue.runtime.esm.js
浏览文件 @
2abdf026
...
...
@@ -9894,4 +9894,4 @@ const compile$1 = () => {
}
};
export
{
BaseTransition
,
Comment
,
Fragment
,
KeepAlive
,
Static
,
Suspense
,
Teleport
,
Text
,
Transition
,
TransitionGroup
,
callWithAsyncErrorHandling
,
callWithErrorHandling
,
cloneVNode
,
compatUtils
,
compile$1
as
compile
,
computed$1
as
computed
,
createApp
,
createBlock
,
createCommentVNode
,
createHydrationRenderer
,
createRenderer
,
createSSRApp
,
createSlots
,
createStaticVNode
,
createTextVNode
,
createVNode
,
createApp
as
createVueApp
,
customRef
,
defineAsyncComponent
,
defineComponent
,
defineEmit
,
defineProps
,
devtools
,
getCurrentInstance
,
getTransitionRawChildren
,
h
,
handleError
,
hydrate
,
initCustomFormatter
,
inject
,
injectHook
,
isInSSRComponentSetup
,
isProxy
,
isReactive
,
isReadonly
,
isRef
,
isRuntimeOnly
,
isVNode
,
markRaw
,
mergeProps
,
nextTick
,
onActivated
,
onBeforeMount
,
onBeforeUnmount
,
onBeforeUpdate
,
onDeactivated
,
onErrorCaptured
,
onMounted
,
onRenderTracked
,
onRenderTriggered
,
onServerPrefetch
,
onUnmounted
,
onUpdated
,
openBlock
,
popScopeId
,
provide
,
proxyRefs
,
pushScopeId
,
queuePostFlushCb
,
reactive
,
readonly
,
ref
,
registerRuntimeCompiler
,
render
,
renderList
,
renderSlot
,
resolveComponent
,
resolveDirective
,
resolveDynamicComponent
,
resolveFilter
,
resolveTransitionHooks
,
setBlockTracking
,
setDevtoolsHook
,
setTransitionHooks
,
shallowReactive
,
shallowReadonly
,
shallowRef
,
ssrContextKey
,
ssrUtils
,
toHandlers
,
toRaw
,
toRef
,
toRefs
,
transformVNodeArgs
,
triggerRef
,
unref
,
useContext
,
useCssModule
,
useCssVars
,
useSSRContext
,
useTransitionState
,
vModelCheckbox
,
vModelDynamic
,
vModelRadio
,
vModelSelect
,
vModelText
,
vShow
,
version
,
warn
,
watch
,
watchEffect
,
withCtx
,
withDirectives
,
withKeys
,
withModifiers
,
withScopeId
};
export
{
BaseTransition
,
Comment
,
Fragment
,
KeepAlive
,
Static
,
Suspense
,
Teleport
,
Text
,
Transition
,
TransitionGroup
,
callWithAsyncErrorHandling
,
callWithErrorHandling
,
cloneVNode
,
compatUtils
,
compile$1
as
compile
,
computed$1
as
computed
,
createApp
,
createBlock
,
createCommentVNode
,
createHydrationRenderer
,
createRenderer
,
createSSRApp
,
createSlots
,
createStaticVNode
,
createTextVNode
,
createVNode
,
createApp
as
createVueApp
,
customRef
,
defineAsyncComponent
,
defineComponent
,
defineEmit
,
defineProps
,
devtools
,
getCurrentInstance
,
getTransitionRawChildren
,
h
,
handleError
,
hydrate
,
initCustomFormatter
,
inject
,
injectHook
,
isInSSRComponentSetup
,
isProxy
,
isReactive
,
isReadonly
,
isRef
,
isRuntimeOnly
,
isVNode
,
markRaw
,
mergeProps
,
nextTick
,
onActivated
,
onBefore
Activate
,
onBeforeDeactivate
,
onBefore
Mount
,
onBeforeUnmount
,
onBeforeUpdate
,
onDeactivated
,
onErrorCaptured
,
onMounted
,
onRenderTracked
,
onRenderTriggered
,
onServerPrefetch
,
onUnmounted
,
onUpdated
,
openBlock
,
popScopeId
,
provide
,
proxyRefs
,
pushScopeId
,
queuePostFlushCb
,
reactive
,
readonly
,
ref
,
registerRuntimeCompiler
,
render
,
renderList
,
renderSlot
,
resolveComponent
,
resolveDirective
,
resolveDynamicComponent
,
resolveFilter
,
resolveTransitionHooks
,
setBlockTracking
,
setDevtoolsHook
,
setTransitionHooks
,
shallowReactive
,
shallowReadonly
,
shallowRef
,
ssrContextKey
,
ssrUtils
,
toHandlers
,
toRaw
,
toRef
,
toRefs
,
transformVNodeArgs
,
triggerRef
,
unref
,
useContext
,
useCssModule
,
useCssVars
,
useSSRContext
,
useTransitionState
,
vModelCheckbox
,
vModelDynamic
,
vModelRadio
,
vModelSelect
,
vModelText
,
vShow
,
version
,
warn
,
watch
,
watchEffect
,
withCtx
,
withDirectives
,
withKeys
,
withModifiers
,
withScopeId
};
packages/uni-h5/dist/uni-h5.cjs.js
浏览文件 @
2abdf026
...
...
@@ -1150,8 +1150,12 @@ function createRouterOptions() {
};
}
function
initHistory
()
{
let
{
base
}
=
__uniConfig
.
router
;
if
(
base
===
"
/
"
)
{
base
=
""
;
}
{
return
vueRouter
.
createMemoryHistory
(
__uniConfig
.
router
.
base
);
return
vueRouter
.
createMemoryHistory
(
base
);
}
}
var
index$s
=
{
...
...
packages/uni-h5/dist/uni-h5.es.js
浏览文件 @
2abdf026
...
...
@@ -4670,7 +4670,11 @@ function removeCurrentPages(delta = 1) {
}
}
function initHistory() {
const history2 = __UNI_FEATURE_ROUTER_MODE__ === "history" ? createWebHistory(__uniConfig.router.base) : createWebHashHistory(__uniConfig.router.base);
let {base} = __uniConfig.router;
if (base === "/") {
base = "";
}
const history2 = __UNI_FEATURE_ROUTER_MODE__ === "history" ? createWebHistory(base) : createWebHashHistory(base);
history2.listen((_to, _from, info) => {
if (info.direction === "back") {
removeCurrentPages(Math.abs(info.delta));
...
...
packages/uni-h5/src/framework/plugin/router.ts
浏览文件 @
2abdf026
...
...
@@ -45,13 +45,17 @@ function removeCurrentPages(delta: number = 1) {
}
function
initHistory
()
{
let
{
base
}
=
__uniConfig
.
router
if
(
base
===
'
/
'
)
{
base
=
''
}
if
(
__NODE_JS__
)
{
return
createMemoryHistory
(
__uniConfig
.
router
.
base
)
return
createMemoryHistory
(
base
)
}
const
history
=
__UNI_FEATURE_ROUTER_MODE__
===
'
history
'
?
createWebHistory
(
__uniConfig
.
router
.
base
)
:
createWebHashHistory
(
__uniConfig
.
router
.
base
)
?
createWebHistory
(
base
)
:
createWebHashHistory
(
base
)
history
.
listen
((
_to
,
_from
,
info
)
=>
{
if
(
info
.
direction
===
'
back
'
)
{
removeCurrentPages
(
Math
.
abs
(
info
.
delta
))
...
...
packages/vite-plugin-uni/src/config/build.ts
浏览文件 @
2abdf026
...
...
@@ -2,15 +2,13 @@ import path from 'path'
import
slash
from
'
slash
'
import
{
UserConfig
}
from
'
vite
'
import
{
VitePluginUniResolvedOptions
}
from
'
..
'
import
{
FEATURE_DEFINES
,
initEasycomsOnce
}
from
'
../utils
'
import
{
initEasycomsOnce
}
from
'
../utils
'
export
function
createBuild
(
options
:
VitePluginUniResolvedOptions
,
features
:
FEATURE_DEFINES
options
:
VitePluginUniResolvedOptions
):
UserConfig
[
'
build
'
]
{
initEasycomsOnce
(
options
.
inputDir
,
options
.
platform
)
return
{
polyfillDynamicImport
:
features
.
__UNI_FEATURE_PAGES__
,
rollupOptions
:
{
output
:
{
chunkFileNames
(
chunkInfo
)
{
...
...
packages/vite-plugin-uni/src/config/index.ts
浏览文件 @
2abdf026
...
...
@@ -11,7 +11,6 @@ import { createServer } from './server'
import
{
createBuild
}
from
'
./build
'
import
{
createOptimizeDeps
}
from
'
./optimizeDeps
'
import
{
createDefine
}
from
'
./define
'
import
{
FEATURE_DEFINES
}
from
'
../utils
'
function
normalizeRoot
(
config
:
UserConfig
)
{
return
normalizePath
(
config
.
root
?
path
.
resolve
(
config
.
root
)
:
process
.
cwd
())
...
...
@@ -34,7 +33,7 @@ export function createConfig(
resolve
:
createResolve
(
options
,
config
),
optimizeDeps
:
createOptimizeDeps
(
options
),
server
:
createServer
(
options
),
build
:
createBuild
(
options
,
define
as
FEATURE_DEFINES
),
build
:
createBuild
(
options
),
css
:
createCss
(
options
),
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录