提交 82042610 编写于 作者: fxy060608's avatar fxy060608

feat(v3): add uniPageUrl

上级 3afce9bd
......@@ -49,6 +49,14 @@ function noop (str) {
return str
}
function getUniPageUrl (path, query) {
const queryString = query ? stringifyQuery(query, noop) : ''
return {
path: path.substr(1),
query: queryString ? queryString.substr(1) : queryString
}
}
function getDebugRefresh (path, query, routeOptions) {
const queryString = query ? stringifyQuery(query, noop) : ''
return {
......@@ -60,7 +68,7 @@ function getDebugRefresh (path, query, routeOptions) {
}
}
export function createWebview (path, routeOptions) {
export function createWebview (path, routeOptions, query) {
if (routeOptions.meta.isNVue) {
const webviewId = id++
const webviewStyle = parseWebviewStyle(
......@@ -68,6 +76,7 @@ export function createWebview (path, routeOptions) {
path,
routeOptions
)
webviewStyle.uniPageUrl = getUniPageUrl(path, query)
if (process.env.NODE_ENV !== 'production') {
console.log(`[uni-app] createWebview`, webviewId, path, webviewStyle)
}
......@@ -89,9 +98,12 @@ export function initWebview (webview, routeOptions, path, query) {
parseInt(webview.id),
'',
routeOptions
)
if (!routeOptions.meta.isNVue) {
webviewStyle.debugRefresh = getDebugRefresh(path, query, routeOptions)
)
webviewStyle.uniPageUrl = getUniPageUrl(path, query)
if (!routeOptions.meta.isNVue) {
webviewStyle.debugRefresh = getDebugRefresh(path, query, routeOptions)
}
if (process.env.NODE_ENV !== 'production') {
console.log(`[uni-app] updateWebview`, webviewStyle)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册