Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
uni-app
提交
e1801408
U
uni-app
项目概览
DCloud
/
uni-app
大约 1 个月 前同步成功
通知
702
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,发现更多精彩内容 >>
提交
e1801408
编写于
8月 08, 2021
作者:
Q
qiang
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'dev' into alpha
# Conflicts: # packages/uni-mp-kuaishou/dist/index.js
上级
4c9df63f
68d23f0d
变更
20
展开全部
隐藏空白更改
内联
并排
Showing
20 changed file
with
2430 addition
and
24 deletion
+2430
-24
packages/uni-app-plus/dist/index.v3.js
packages/uni-app-plus/dist/index.v3.js
+3
-3
packages/uni-app-plus/lib/uni.config.js
packages/uni-app-plus/lib/uni.config.js
+1
-1
packages/uni-mp-alipay/dist/uni.mp.esm.js
packages/uni-mp-alipay/dist/uni.mp.esm.js
+51
-0
packages/uni-mp-baidu/dist/uni.mp.esm.js
packages/uni-mp-baidu/dist/uni.mp.esm.js
+51
-0
packages/uni-mp-kuaishou/dist/index.js
packages/uni-mp-kuaishou/dist/index.js
+2
-3
packages/uni-mp-kuaishou/dist/uni.api.esm.js
packages/uni-mp-kuaishou/dist/uni.api.esm.js
+845
-0
packages/uni-mp-kuaishou/dist/uni.mp.esm.js
packages/uni-mp-kuaishou/dist/uni.mp.esm.js
+1282
-0
packages/uni-mp-qq/dist/uni.mp.esm.js
packages/uni-mp-qq/dist/uni.mp.esm.js
+51
-0
packages/uni-mp-toutiao/dist/uni.mp.esm.js
packages/uni-mp-toutiao/dist/uni.mp.esm.js
+51
-0
packages/uni-mp-weixin/dist/uni.mp.esm.js
packages/uni-mp-weixin/dist/uni.mp.esm.js
+51
-0
packages/uni-mp-weixin/lib/uni.config.js
packages/uni-mp-weixin/lib/uni.config.js
+2
-1
packages/uni-template-compiler/__tests__/compiler-mp-weixin.spec.js
...ni-template-compiler/__tests__/compiler-mp-weixin.spec.js
+8
-0
packages/uni-template-compiler/lib/mp.js
packages/uni-template-compiler/lib/mp.js
+2
-1
packages/uni-template-compiler/lib/script/traverse/resolve-scoped-slots.js
...late-compiler/lib/script/traverse/resolve-scoped-slots.js
+12
-2
packages/vue-cli-plugin-hbuilderx/build/webpack.nvue.conf.js
packages/vue-cli-plugin-hbuilderx/build/webpack.nvue.conf.js
+11
-1
packages/vue-cli-plugin-uni/lib/env.js
packages/vue-cli-plugin-uni/lib/env.js
+0
-4
packages/vue-cli-plugin-uni/lib/mp/index.js
packages/vue-cli-plugin-uni/lib/mp/index.js
+2
-2
packages/vue-cli-plugin-uni/packages/uni-cloud/dist/index.js
packages/vue-cli-plugin-uni/packages/uni-cloud/dist/index.js
+1
-1
packages/webpack-uni-mp-loader/lib/plugin/index-new.js
packages/webpack-uni-mp-loader/lib/plugin/index-new.js
+2
-2
src/platforms/mp-kuaishou/runtime/wrapper/component-parser.js
...platforms/mp-kuaishou/runtime/wrapper/component-parser.js
+2
-3
未找到文件。
packages/uni-app-plus/dist/index.v3.js
浏览文件 @
e1801408
...
...
@@ -1400,9 +1400,6 @@ var serviceContext = (function () {
t(key, values) {
return t(key, values);
},
getLocale() {
return i18n.getLocale();
},
setLocale(newLocale) {
return i18n.setLocale(newLocale);
},
...
...
@@ -20964,6 +20961,9 @@ var serviceContext = (function () {
}
const evalJSCode =
`typeof UniViewJSBridge !== 'undefined' && UniViewJSBridge.subscribeHandler("${eventType}",${args},__PAGE_ID__)`;
if (process.env.NODE_ENV !== 'production') {
console.log(`UNIAPP[publishHandler]:[${+new Date()}]`, 'length', evalJSCode.length);
}
pageIds.forEach(id => {
const webview = plus.webview.getWebviewById(String(id));
webview && webview.evalJS(evalJSCode.replace('__PAGE_ID__', id));
...
...
packages/uni-app-plus/lib/uni.config.js
浏览文件 @
e1801408
...
...
@@ -27,7 +27,7 @@ module.exports = {
subPackages
:
true
},
copyWebpackOptions
(
platformOptions
,
vueOptions
)
{
const
copyOptions
=
[]
const
copyOptions
=
[
'
androidPrivacy.json
'
]
const
componentsCopyOption
=
getComponentsCopyOption
()
if
(
componentsCopyOption
)
{
copyOptions
.
push
(
componentsCopyOption
)
...
...
packages/uni-mp-alipay/dist/uni.mp.esm.js
浏览文件 @
e1801408
import
{
isPlainObject
,
isArray
,
extend
,
hyphenate
,
isObject
,
hasOwn
,
toNumber
,
capitalize
,
isFunction
,
NOOP
,
EMPTY_OBJ
,
camelize
}
from
'
@vue/shared
'
;
import
{
onUnmounted
}
from
'
vue
'
;
const
encode
=
encodeURIComponent
;
function
stringifyQuery
(
obj
,
encodeStr
=
encode
)
{
...
...
@@ -391,6 +392,9 @@ function initBaseInstance(instance, options) {
}
function
initComponentInstance
(
instance
,
options
)
{
initBaseInstance
(
instance
,
options
);
{
initScopedSlotsParams
(
instance
);
}
const
ctx
=
instance
.
ctx
;
MP_METHODS
.
forEach
((
method
)
=>
{
ctx
[
method
]
=
function
(...
args
)
{
...
...
@@ -440,6 +444,53 @@ function callHook(name, args) {
}
const
hooks
=
this
.
$
[
name
];
return
hooks
&&
invokeArrayFns
(
hooks
,
args
);
}
const
center
=
{};
const
parents
=
{};
function
initScopedSlotsParams
(
instance
)
{
const
ctx
=
instance
.
ctx
;
ctx
.
$hasScopedSlotsParams
=
function
(
vueId
)
{
const
has
=
center
[
vueId
];
if
(
!
has
)
{
parents
[
vueId
]
=
this
;
onUnmounted
(()
=>
{
delete
parents
[
vueId
];
},
instance
);
}
return
has
;
};
ctx
.
$getScopedSlotsParams
=
function
(
vueId
,
name
,
key
)
{
const
data
=
center
[
vueId
];
if
(
data
)
{
const
object
=
data
[
name
]
||
{};
return
key
?
object
[
key
]
:
object
;
}
else
{
parents
[
vueId
]
=
this
;
onUnmounted
(()
=>
{
delete
parents
[
vueId
];
},
instance
);
}
};
ctx
.
$setScopedSlotsParams
=
function
(
name
,
value
)
{
const
vueIds
=
instance
.
attrs
.
vueId
;
if
(
vueIds
)
{
const
vueId
=
vueIds
.
split
(
'
,
'
)[
0
];
const
object
=
center
[
vueId
]
=
center
[
vueId
]
||
{};
object
[
name
]
=
value
;
if
(
parents
[
vueId
])
{
parents
[
vueId
].
$forceUpdate
();
}
}
};
onUnmounted
(
function
()
{
const
propsData
=
instance
.
attrs
;
const
vueId
=
propsData
&&
propsData
.
vueId
;
if
(
vueId
)
{
delete
center
[
vueId
];
delete
parents
[
vueId
];
}
},
instance
);
}
const
PAGE_HOOKS
=
[
...
...
packages/uni-mp-baidu/dist/uni.mp.esm.js
浏览文件 @
e1801408
import
{
isPlainObject
,
hasOwn
,
isArray
,
extend
,
hyphenate
,
isObject
,
toNumber
,
isFunction
,
NOOP
,
camelize
}
from
'
@vue/shared
'
;
import
{
onUnmounted
}
from
'
vue
'
;
const
encode
=
encodeURIComponent
;
function
stringifyQuery
(
obj
,
encodeStr
=
encode
)
{
...
...
@@ -419,6 +420,9 @@ function initBaseInstance(instance, options) {
}
function
initComponentInstance
(
instance
,
options
)
{
initBaseInstance
(
instance
,
options
);
{
initScopedSlotsParams
(
instance
);
}
const
ctx
=
instance
.
ctx
;
MP_METHODS
.
forEach
((
method
)
=>
{
ctx
[
method
]
=
function
(...
args
)
{
...
...
@@ -465,6 +469,53 @@ function callHook(name, args) {
}
const
hooks
=
this
.
$
[
name
];
return
hooks
&&
invokeArrayFns
(
hooks
,
args
);
}
const
center
=
{};
const
parents
=
{};
function
initScopedSlotsParams
(
instance
)
{
const
ctx
=
instance
.
ctx
;
ctx
.
$hasScopedSlotsParams
=
function
(
vueId
)
{
const
has
=
center
[
vueId
];
if
(
!
has
)
{
parents
[
vueId
]
=
this
;
onUnmounted
(()
=>
{
delete
parents
[
vueId
];
},
instance
);
}
return
has
;
};
ctx
.
$getScopedSlotsParams
=
function
(
vueId
,
name
,
key
)
{
const
data
=
center
[
vueId
];
if
(
data
)
{
const
object
=
data
[
name
]
||
{};
return
key
?
object
[
key
]
:
object
;
}
else
{
parents
[
vueId
]
=
this
;
onUnmounted
(()
=>
{
delete
parents
[
vueId
];
},
instance
);
}
};
ctx
.
$setScopedSlotsParams
=
function
(
name
,
value
)
{
const
vueIds
=
instance
.
attrs
.
vueId
;
if
(
vueIds
)
{
const
vueId
=
vueIds
.
split
(
'
,
'
)[
0
];
const
object
=
center
[
vueId
]
=
center
[
vueId
]
||
{};
object
[
name
]
=
value
;
if
(
parents
[
vueId
])
{
parents
[
vueId
].
$forceUpdate
();
}
}
};
onUnmounted
(
function
()
{
const
propsData
=
instance
.
attrs
;
const
vueId
=
propsData
&&
propsData
.
vueId
;
if
(
vueId
)
{
delete
center
[
vueId
];
delete
parents
[
vueId
];
}
},
instance
);
}
const
PAGE_HOOKS
=
[
...
...
packages/uni-mp-kuaishou/dist/index.js
浏览文件 @
e1801408
...
...
@@ -1845,13 +1845,12 @@ function fixSetDataEnd (mpInstance) {
}
}
const
SDKVersion
=
ks
.
getSystemInfoSync
().
SDKVersion
;
function
parseComponent$1
(
vueComponentOptions
)
{
const
componentOptions
=
parseComponent
(
vueComponentOptions
);
const
oldAttached
=
componentOptions
.
lifetimes
.
attached
;
componentOptions
.
lifetimes
.
attached
=
function
attached
()
{
if
(
isPage
.
call
(
this
)
&&
parseFloat
(
SDKVersion
)
<=
1.13
)
{
// 暂不区分版本
if
(
isPage
.
call
(
this
))
{
// 解决快手小程序页面 attached 生命周期 setData 导致数据同步异常的问题
fixSetDataStart
(
this
);
setTimeout
(()
=>
{
...
...
packages/uni-mp-kuaishou/dist/uni.api.esm.js
0 → 100644
浏览文件 @
e1801408
此差异已折叠。
点击以展开。
packages/uni-mp-kuaishou/dist/uni.mp.esm.js
0 → 100644
浏览文件 @
e1801408
此差异已折叠。
点击以展开。
packages/uni-mp-qq/dist/uni.mp.esm.js
浏览文件 @
e1801408
import
{
isPlainObject
,
hasOwn
,
isArray
,
extend
,
hyphenate
,
isObject
,
toNumber
,
isFunction
,
NOOP
,
camelize
}
from
'
@vue/shared
'
;
import
{
onUnmounted
}
from
'
vue
'
;
const
encode
=
encodeURIComponent
;
function
stringifyQuery
(
obj
,
encodeStr
=
encode
)
{
...
...
@@ -419,6 +420,9 @@ function initBaseInstance(instance, options) {
}
function
initComponentInstance
(
instance
,
options
)
{
initBaseInstance
(
instance
,
options
);
{
initScopedSlotsParams
(
instance
);
}
const
ctx
=
instance
.
ctx
;
MP_METHODS
.
forEach
((
method
)
=>
{
ctx
[
method
]
=
function
(...
args
)
{
...
...
@@ -465,6 +469,53 @@ function callHook(name, args) {
}
const
hooks
=
this
.
$
[
name
];
return
hooks
&&
invokeArrayFns
(
hooks
,
args
);
}
const
center
=
{};
const
parents
=
{};
function
initScopedSlotsParams
(
instance
)
{
const
ctx
=
instance
.
ctx
;
ctx
.
$hasScopedSlotsParams
=
function
(
vueId
)
{
const
has
=
center
[
vueId
];
if
(
!
has
)
{
parents
[
vueId
]
=
this
;
onUnmounted
(()
=>
{
delete
parents
[
vueId
];
},
instance
);
}
return
has
;
};
ctx
.
$getScopedSlotsParams
=
function
(
vueId
,
name
,
key
)
{
const
data
=
center
[
vueId
];
if
(
data
)
{
const
object
=
data
[
name
]
||
{};
return
key
?
object
[
key
]
:
object
;
}
else
{
parents
[
vueId
]
=
this
;
onUnmounted
(()
=>
{
delete
parents
[
vueId
];
},
instance
);
}
};
ctx
.
$setScopedSlotsParams
=
function
(
name
,
value
)
{
const
vueIds
=
instance
.
attrs
.
vueId
;
if
(
vueIds
)
{
const
vueId
=
vueIds
.
split
(
'
,
'
)[
0
];
const
object
=
center
[
vueId
]
=
center
[
vueId
]
||
{};
object
[
name
]
=
value
;
if
(
parents
[
vueId
])
{
parents
[
vueId
].
$forceUpdate
();
}
}
};
onUnmounted
(
function
()
{
const
propsData
=
instance
.
attrs
;
const
vueId
=
propsData
&&
propsData
.
vueId
;
if
(
vueId
)
{
delete
center
[
vueId
];
delete
parents
[
vueId
];
}
},
instance
);
}
const
PAGE_HOOKS
=
[
...
...
packages/uni-mp-toutiao/dist/uni.mp.esm.js
浏览文件 @
e1801408
import
{
isPlainObject
,
hasOwn
,
isArray
,
extend
,
hyphenate
,
isObject
,
toNumber
,
isFunction
,
NOOP
,
camelize
}
from
'
@vue/shared
'
;
import
{
onUnmounted
}
from
'
vue
'
;
const
encode
=
encodeURIComponent
;
function
stringifyQuery
(
obj
,
encodeStr
=
encode
)
{
...
...
@@ -419,6 +420,9 @@ function initBaseInstance(instance, options) {
}
function
initComponentInstance
(
instance
,
options
)
{
initBaseInstance
(
instance
,
options
);
{
initScopedSlotsParams
(
instance
);
}
const
ctx
=
instance
.
ctx
;
MP_METHODS
.
forEach
((
method
)
=>
{
ctx
[
method
]
=
function
(...
args
)
{
...
...
@@ -465,6 +469,53 @@ function callHook(name, args) {
}
const
hooks
=
this
.
$
[
name
];
return
hooks
&&
invokeArrayFns
(
hooks
,
args
);
}
const
center
=
{};
const
parents
=
{};
function
initScopedSlotsParams
(
instance
)
{
const
ctx
=
instance
.
ctx
;
ctx
.
$hasScopedSlotsParams
=
function
(
vueId
)
{
const
has
=
center
[
vueId
];
if
(
!
has
)
{
parents
[
vueId
]
=
this
;
onUnmounted
(()
=>
{
delete
parents
[
vueId
];
},
instance
);
}
return
has
;
};
ctx
.
$getScopedSlotsParams
=
function
(
vueId
,
name
,
key
)
{
const
data
=
center
[
vueId
];
if
(
data
)
{
const
object
=
data
[
name
]
||
{};
return
key
?
object
[
key
]
:
object
;
}
else
{
parents
[
vueId
]
=
this
;
onUnmounted
(()
=>
{
delete
parents
[
vueId
];
},
instance
);
}
};
ctx
.
$setScopedSlotsParams
=
function
(
name
,
value
)
{
const
vueIds
=
instance
.
attrs
.
vueId
;
if
(
vueIds
)
{
const
vueId
=
vueIds
.
split
(
'
,
'
)[
0
];
const
object
=
center
[
vueId
]
=
center
[
vueId
]
||
{};
object
[
name
]
=
value
;
if
(
parents
[
vueId
])
{
parents
[
vueId
].
$forceUpdate
();
}
}
};
onUnmounted
(
function
()
{
const
propsData
=
instance
.
attrs
;
const
vueId
=
propsData
&&
propsData
.
vueId
;
if
(
vueId
)
{
delete
center
[
vueId
];
delete
parents
[
vueId
];
}
},
instance
);
}
const
PAGE_HOOKS
=
[
...
...
packages/uni-mp-weixin/dist/uni.mp.esm.js
浏览文件 @
e1801408
import
{
isPlainObject
,
hasOwn
,
isArray
,
extend
,
hyphenate
,
isObject
,
toNumber
,
isFunction
,
NOOP
,
camelize
}
from
'
@vue/shared
'
;
import
{
onUnmounted
}
from
'
vue
'
;
const
encode
=
encodeURIComponent
;
function
stringifyQuery
(
obj
,
encodeStr
=
encode
)
{
...
...
@@ -365,6 +366,9 @@ function initBaseInstance(instance, options) {
}
function
initComponentInstance
(
instance
,
options
)
{
initBaseInstance
(
instance
,
options
);
{
initScopedSlotsParams
(
instance
);
}
const
ctx
=
instance
.
ctx
;
MP_METHODS
.
forEach
((
method
)
=>
{
ctx
[
method
]
=
function
(...
args
)
{
...
...
@@ -411,6 +415,53 @@ function callHook(name, args) {
}
const
hooks
=
this
.
$
[
name
];
return
hooks
&&
invokeArrayFns
(
hooks
,
args
);
}
const
center
=
{};
const
parents
=
{};
function
initScopedSlotsParams
(
instance
)
{
const
ctx
=
instance
.
ctx
;
ctx
.
$hasScopedSlotsParams
=
function
(
vueId
)
{
const
has
=
center
[
vueId
];
if
(
!
has
)
{
parents
[
vueId
]
=
this
;
onUnmounted
(()
=>
{
delete
parents
[
vueId
];
},
instance
);
}
return
has
;
};
ctx
.
$getScopedSlotsParams
=
function
(
vueId
,
name
,
key
)
{
const
data
=
center
[
vueId
];
if
(
data
)
{
const
object
=
data
[
name
]
||
{};
return
key
?
object
[
key
]
:
object
;
}
else
{
parents
[
vueId
]
=
this
;
onUnmounted
(()
=>
{
delete
parents
[
vueId
];
},
instance
);
}
};
ctx
.
$setScopedSlotsParams
=
function
(
name
,
value
)
{
const
vueIds
=
instance
.
attrs
.
vueId
;
if
(
vueIds
)
{
const
vueId
=
vueIds
.
split
(
'
,
'
)[
0
];
const
object
=
center
[
vueId
]
=
center
[
vueId
]
||
{};
object
[
name
]
=
value
;
if
(
parents
[
vueId
])
{
parents
[
vueId
].
$forceUpdate
();
}
}
};
onUnmounted
(
function
()
{
const
propsData
=
instance
.
attrs
;
const
vueId
=
propsData
&&
propsData
.
vueId
;
if
(
vueId
)
{
delete
center
[
vueId
];
delete
parents
[
vueId
];
}
},
instance
);
}
const
PAGE_HOOKS
=
[
...
...
packages/uni-mp-weixin/lib/uni.config.js
浏览文件 @
e1801408
...
...
@@ -28,7 +28,8 @@ module.exports = {
'
sitemap.json
'
,
'
ext.json
'
,
'
custom-tab-bar
'
,
'
plugin.json
'
'
plugin.json
'
,
'
functional-pages
'
]
const
workers
=
platformOptions
.
workers
workers
&&
copyOptions
.
push
(
workers
)
...
...
packages/uni-template-compiler/__tests__/compiler-mp-weixin.spec.js
浏览文件 @
e1801408
...
...
@@ -97,6 +97,14 @@ describe('mp:compiler-mp-weixin', () => {
scopedSlotsCompiler
:
'
auto
'
}
)
assertCodegen
(
'
<my-component><template v-slot="{item}"><view @click="getValue(item)">{{item}}</view><template></my-component>
'
,
'
<my-component generic:scoped-slots-default="test-my-component-default" data-vue-generic="scoped" vue-id="551070e6-1" bind:__l="__l" vue-slots="{{[
\'
default
\'
]}}"></my-component>
'
,
'
with(this){}
'
,
{
scopedSlotsCompiler
:
'
auto
'
}
)
assertCodegen
(
'
<my-component><template v-slot="{item}">{{getValue(item)}}<template></my-component>
'
,
'
<my-component scoped-slots-compiler="augmented" vue-id="551070e6-1" bind:__l="__l" vue-slots="{{[
\'
default
\'
]}}"><block><block wx:if="{{$root.m0}}">{{$root.m1}}</block></block></my-component>
'
,
...
...
packages/uni-template-compiler/lib/mp.js
浏览文件 @
e1801408
...
...
@@ -62,7 +62,8 @@ const tags = {
'
cashier
'
,
'
ix-grid
'
,
'
ix-native-grid
'
,
'
ix-native-list
'
'
ix-native-list
'
,
'
mkt
'
]
}
...
...
packages/uni-template-compiler/lib/script/traverse/resolve-scoped-slots.js
浏览文件 @
e1801408
...
...
@@ -2,17 +2,27 @@ const t = require('@babel/types')
const
{
METHOD_BUILT_IN
,
METHOD_CREATE_EMPTY_VNODE
METHOD_CREATE_EMPTY_VNODE
,
METHOD_CREATE_ELEMENT
}
=
require
(
'
../../constants
'
)
function
needSlotMode
(
path
,
ids
)
{
let
need
path
.
traverse
({
noScope
:
false
,
Property
(
path
)
{
// 跳过事件
if
(
path
.
node
.
key
.
name
===
'
on
'
)
{
const
parentPath
=
path
.
parentPath
.
parentPath
if
(
t
.
isCallExpression
(
parentPath
)
&&
parentPath
.
node
.
callee
.
name
===
METHOD_CREATE_ELEMENT
)
{
path
.
skip
()
}
}
},
Identifier
(
path
)
{
const
name
=
path
.
node
.
name
if
(
path
.
key
!==
'
key
'
&&
(
path
.
key
!==
'
property
'
||
path
.
parent
.
computed
))
{
// 使用方法或作用域外数据
// 使用
作用域内
方法或作用域外数据
if
(
name
in
ids
)
{
need
=
path
.
key
===
'
callee
'
?
true
:
need
}
else
if
(
!
path
.
scope
.
hasBinding
(
name
)
&&
!
METHOD_BUILT_IN
.
includes
(
name
))
{
...
...
packages/vue-cli-plugin-hbuilderx/build/webpack.nvue.conf.js
浏览文件 @
e1801408
...
...
@@ -208,7 +208,16 @@ if (process.env.UNI_USING_NATIVE || process.env.UNI_USING_V3_NATIVE) {
const
array
=
[{
from
:
path
.
resolve
(
process
.
env
.
UNI_INPUT_DIR
,
'
static
'
),
to
:
'
static
'
}]
}]
const
androidPrivacyPath
=
path
.
resolve
(
process
.
env
.
UNI_INPUT_DIR
,
'
androidPrivacy.json
'
)
if
(
fs
.
existsSync
(
androidPrivacyPath
))
{
array
.
push
({
from
:
androidPrivacyPath
,
to
:
'
androidPrivacy.json
'
})
}
const
hybridHtmlPath
=
path
.
resolve
(
process
.
env
.
UNI_INPUT_DIR
,
'
hybrid/html
'
)
if
(
fs
.
existsSync
(
hybridHtmlPath
))
{
array
.
push
({
...
...
@@ -216,6 +225,7 @@ if (process.env.UNI_USING_NATIVE || process.env.UNI_USING_V3_NATIVE) {
to
:
'
hybrid/html
'
})
}
if
(
process
.
env
.
UNI_USING_NVUE_COMPILER
)
{
array
.
push
({
from
:
path
.
resolve
(
getTemplatePath
(),
'
common
'
),
...
...
packages/vue-cli-plugin-uni/lib/env.js
浏览文件 @
e1801408
...
...
@@ -283,10 +283,6 @@ process.env.SCOPED_SLOTS_COMPILER = modes.includes(scopedSlotsCompiler) ? scoped
if
(
process
.
env
.
UNI_PLATFORM
===
'
mp-kuaishou
'
&&
process
.
env
.
SCOPED_SLOTS_COMPILER
!==
modes
[
0
])
{
process
.
env
.
SCOPED_SLOTS_COMPILER
=
modes
[
2
]
}
// Vue3 暂时固定为 legacy 模式
if
(
process
.
env
.
UNI_USING_VUE3
)
{
process
.
env
.
SCOPED_SLOTS_COMPILER
=
modes
[
0
]
}
if
(
process
.
env
.
UNI_USING_COMPONENTS
||
...
...
packages/vue-cli-plugin-uni/lib/mp/index.js
浏览文件 @
e1801408
...
...
@@ -172,7 +172,7 @@ module.exports = {
if
(
process
.
env
.
UNI_MP_PLUGIN
)
{
// 小程序插件入口使用
// packages\webpack-uni-mp-loader\lib\plugin\index-new.js -> addMPPluginRequire
beforeCode
+=
`wx.__webpack_require_
${
process
.
env
.
UNI_MP_PLUGIN
.
replace
(
'
-
'
,
'
_
'
)}
__ = __webpack_require__;`
beforeCode
+=
`wx.__webpack_require_
${
process
.
env
.
UNI_MP_PLUGIN
.
replace
(
/-/g
,
'
_
'
)}
__ = __webpack_require__;`
const
UNI_MP_PLUGIN_MAIN
=
process
.
env
.
UNI_MP_PLUGIN_MAIN
if
(
UNI_MP_PLUGIN_MAIN
)
{
...
...
@@ -304,4 +304,4 @@ module.exports = {
webpackConfig
.
plugins
.
delete
(
'
preload
'
)
webpackConfig
.
plugins
.
delete
(
'
prefetch
'
)
}
}
}
packages/vue-cli-plugin-uni/packages/uni-cloud/dist/index.js
浏览文件 @
e1801408
此差异已折叠。
点击以展开。
packages/webpack-uni-mp-loader/lib/plugin/index-new.js
浏览文件 @
e1801408
...
...
@@ -73,14 +73,14 @@ function addMPPluginRequire (compilation) {
if
(
name
===
process
.
env
.
UNI_MP_PLUGIN_MAIN
)
{
const
modules
=
compilation
.
modules
const
mainFilePath
=
path
.
resolve
(
process
.
env
.
UNI_INPUT_DIR
,
process
.
env
.
UNI_MP_PLUGIN_MAIN
).
replace
(
/
\\
/g
,
'
/
'
)
const
mainFilePath
=
normalizePath
(
path
.
resolve
(
process
.
env
.
UNI_INPUT_DIR
,
process
.
env
.
UNI_MP_PLUGIN_MAIN
)
)
const
uniModuleId
=
modules
.
find
(
module
=>
module
.
resource
&&
normalizePath
(
module
.
resource
)
===
mainFilePath
).
id
const
newlineIndex
=
compilation
.
assets
[
name
].
source
().
lastIndexOf
(
'
\n
'
)
const
source
=
compilation
.
assets
[
name
].
source
().
substring
(
0
,
newlineIndex
)
+
`\nmodule.exports = wx.__webpack_require_
${
process
.
env
.
UNI_MP_PLUGIN
.
replace
(
'
-
'
,
'
_
'
)}
__(
${
uniModuleId
}
);\n`
+
`\nmodule.exports = wx.__webpack_require_
${
process
.
env
.
UNI_MP_PLUGIN
.
replace
(
/-/g
,
'
_
'
)}
__('
${
uniModuleId
}
'
);\n`
+
compilation
.
assets
[
name
].
source
().
substring
(
newlineIndex
+
1
)
compilation
.
assets
[
name
]
=
{
...
...
src/platforms/mp-kuaishou/runtime/wrapper/component-parser.js
浏览文件 @
e1801408
...
...
@@ -7,13 +7,12 @@ import {
fixSetDataEnd
}
from
'
../../../mp-weixin/runtime/wrapper/fix-set-data
'
const
SDKVersion
=
__GLOBAL__
.
getSystemInfoSync
().
SDKVersion
export
default
function
parseComponent
(
vueComponentOptions
)
{
const
componentOptions
=
parseBaseComponent
(
vueComponentOptions
)
const
oldAttached
=
componentOptions
.
lifetimes
.
attached
componentOptions
.
lifetimes
.
attached
=
function
attached
()
{
if
(
isPage
.
call
(
this
)
&&
parseFloat
(
SDKVersion
)
<=
1.13
)
{
// 暂不区分版本
if
(
isPage
.
call
(
this
))
{
// 解决快手小程序页面 attached 生命周期 setData 导致数据同步异常的问题
fixSetDataStart
(
this
)
setTimeout
(()
=>
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录