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

Merge branch 'dev' of https://github.com/dcloudio/uni-app into alpha

...@@ -6070,7 +6070,7 @@ function createPatchFunction (backend) { ...@@ -6070,7 +6070,7 @@ function createPatchFunction (backend) {
function removeAndInvokeRemoveHook (vnode, rm) { function removeAndInvokeRemoveHook (vnode, rm) {
if (isDef(rm) || isDef(vnode.data)) { if (isDef(rm) || isDef(vnode.data)) {
var i; var i, children;
var listeners = cbs.remove.length + 1; var listeners = cbs.remove.length + 1;
if (isDef(rm)) { if (isDef(rm)) {
// we have a recursively passed down rm callback // we have a recursively passed down rm callback
...@@ -6083,6 +6083,14 @@ function createPatchFunction (backend) { ...@@ -6083,6 +6083,14 @@ function createPatchFunction (backend) {
// recursively invoke hooks on child component root node // recursively invoke hooks on child component root node
if (isDef(i = vnode.componentInstance) && isDef(i = i._vnode) && isDef(i.data)) { if (isDef(i = vnode.componentInstance) && isDef(i = i._vnode) && isDef(i.data)) {
removeAndInvokeRemoveHook(i, rm); removeAndInvokeRemoveHook(i, rm);
} else if (isDef(children = vnode.children)) {
// app-plus service 层 elm 暂未实现父子关系维护,移除父 elm 时,导致子 elm 还存留(影响了事件查找)
// 暂时使用 vnode 的 children 递归 rm 掉子 elm
for (i = 0; i < children.length; i++) {
if (children[i].tag) {
removeAndInvokeRemoveHook(children[i]);
}
}
} }
for (i = 0; i < cbs.remove.length; ++i) { for (i = 0; i < cbs.remove.length; ++i) {
cbs.remove[i](vnode, rm); cbs.remove[i](vnode, rm);
......
...@@ -5288,7 +5288,7 @@ function createPatchFunction (backend) { ...@@ -5288,7 +5288,7 @@ function createPatchFunction (backend) {
function removeAndInvokeRemoveHook (vnode, rm) { function removeAndInvokeRemoveHook (vnode, rm) {
if (isDef(rm) || isDef(vnode.data)) { if (isDef(rm) || isDef(vnode.data)) {
var i; var i, children;
var listeners = cbs.remove.length + 1; var listeners = cbs.remove.length + 1;
if (isDef(rm)) { if (isDef(rm)) {
// we have a recursively passed down rm callback // we have a recursively passed down rm callback
...@@ -5301,6 +5301,14 @@ function createPatchFunction (backend) { ...@@ -5301,6 +5301,14 @@ function createPatchFunction (backend) {
// recursively invoke hooks on child component root node // recursively invoke hooks on child component root node
if (isDef(i = vnode.componentInstance) && isDef(i = i._vnode) && isDef(i.data)) { if (isDef(i = vnode.componentInstance) && isDef(i = i._vnode) && isDef(i.data)) {
removeAndInvokeRemoveHook(i, rm); removeAndInvokeRemoveHook(i, rm);
} else if (isDef(children = vnode.children)) {
// app-plus service 层 elm 暂未实现父子关系维护,移除父 elm 时,导致子 elm 还存留(影响了事件查找)
// 暂时使用 vnode 的 children 递归 rm 掉子 elm
for (i = 0; i < children.length; i++) {
if (children[i].tag) {
removeAndInvokeRemoveHook(children[i]);
}
}
} }
for (i = 0; i < cbs.remove.length; ++i) { for (i = 0; i < cbs.remove.length; ++i) {
cbs.remove[i](vnode, rm); cbs.remove[i](vnode, rm);
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* wxs getRegExp * wxs getRegExp
*/ */
function getRegExp () { function getRegExp () {
const args = Array.prototype.slice.call(arguments); var args = Array.prototype.slice.call(arguments);
args.unshift(RegExp); args.unshift(RegExp);
return new (Function.prototype.bind.apply(RegExp, args))() return new (Function.prototype.bind.apply(RegExp, args))()
} }
...@@ -11,7 +11,7 @@ function getRegExp () { ...@@ -11,7 +11,7 @@ function getRegExp () {
* wxs getDate * wxs getDate
*/ */
function getDate () { function getDate () {
const args = Array.prototype.slice.call(arguments); var args = Array.prototype.slice.call(arguments);
args.unshift(Date); args.unshift(Date);
return new (Function.prototype.bind.apply(Date, args))() return new (Function.prototype.bind.apply(Date, args))()
} }
......
...@@ -132,7 +132,7 @@ const v3 = { ...@@ -132,7 +132,7 @@ const v3 = {
return { return {
devtool, devtool,
mode: process.env.NODE_ENV, mode: process.env.NODE_ENV === 'production' ? 'production' : 'development',
externals: { externals: {
vue: 'Vue' vue: 'Vue'
}, },
......
...@@ -268,8 +268,8 @@ if (process.env.UNI_USING_COMPONENTS) { // 是否启用分包优化 ...@@ -268,8 +268,8 @@ if (process.env.UNI_USING_COMPONENTS) { // 是否启用分包优化
const warningMsg = const warningMsg =
usingComponentsAbsent usingComponentsAbsent
? `该应用之前可能是非自定义组件模式,目前以自定义组件模式运行。非自定义组件于2019年11月1日起停止支持。详见:https://ask.dcloud.net.cn/article/36385` ? `该应用之前可能是非自定义组件模式,目前以自定义组件模式运行。非自定义组件于2019年11月1日起停止支持。详见:https://ask.dcloud.net.cn/article/36385`
: `uni-app于2019年11月1日起停止支持非自定义组件模式 [详情](https://ask.dcloud.net.cn/article/36385)` : `uni-app于2019年11月1日起停止支持非自定义组件模式 [详情](https://ask.dcloud.net.cn/article/36385)`
const needWarning = !platformOptions.usingComponents || usingComponentsAbsent const needWarning = !platformOptions.usingComponents || usingComponentsAbsent
let hasNVue = false let hasNVue = false
......
...@@ -104,7 +104,7 @@ module.exports = { ...@@ -104,7 +104,7 @@ module.exports = {
return { return {
devtool, devtool,
mode: process.env.NODE_ENV, mode: process.env.NODE_ENV === 'production' ? 'production' : 'development',
entry () { entry () {
return process.UNI_ENTRY return process.UNI_ENTRY
}, },
......
...@@ -41,7 +41,7 @@ var isReady=false;var onReadyCallbacks=[]; ...@@ -41,7 +41,7 @@ var isReady=false;var onReadyCallbacks=[];
var __uniConfig = ${JSON.stringify(appJson, null)}; var __uniConfig = ${JSON.stringify(appJson, null)};
var __uniRoutes = ${JSON.stringify(__uniRoutes)}; var __uniRoutes = ${JSON.stringify(__uniRoutes)};
__uniConfig.onReady=function(callback){if(__uniConfig.ready){callback()}else{onReadyCallbacks.push(callback)}};Object.defineProperty(__uniConfig,"ready",{get:function(){return isReady},set:function(val){isReady=val;if(!isReady){return}const callbacks=onReadyCallbacks.slice(0);onReadyCallbacks.length=0;callbacks.forEach(function(callback){callback()})}}); __uniConfig.onReady=function(callback){if(__uniConfig.ready){callback()}else{onReadyCallbacks.push(callback)}};Object.defineProperty(__uniConfig,"ready",{get:function(){return isReady},set:function(val){isReady=val;if(!isReady){return}const callbacks=onReadyCallbacks.slice(0);onReadyCallbacks.length=0;callbacks.forEach(function(callback){callback()})}});
service.register("uni-app-config",{create(a,b,c){if(!__uniConfig.viewport){var d=b.weex.config.env.scale,e=b.weex.config.env.deviceWidth,f=Math.ceil(e/d);Object.assign(__uniConfig,{viewport:f,defaultFontSize:Math.round(f/20)})}return{instance:{__uniConfig:__uniConfig,__uniRoutes:__uniRoutes}}}}); service.register("uni-app-config",{create(a,b,c){if(!__uniConfig.viewport){var d=b.weex.config.env.scale,e=b.weex.config.env.deviceWidth,f=Math.ceil(e/d);Object.assign(__uniConfig,{viewport:f,defaultFontSize:Math.round(f/20)})}return{instance:{__uniConfig:__uniConfig,__uniRoutes:__uniRoutes,window:void 0}}}});
` `
} }
} }
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* wxs getRegExp * wxs getRegExp
*/ */
export function getRegExp () { export function getRegExp () {
const args = Array.prototype.slice.call(arguments) var args = Array.prototype.slice.call(arguments)
args.unshift(RegExp) args.unshift(RegExp)
return new (Function.prototype.bind.apply(RegExp, args))() return new (Function.prototype.bind.apply(RegExp, args))()
} }
...@@ -11,7 +11,7 @@ export function getRegExp () { ...@@ -11,7 +11,7 @@ export function getRegExp () {
* wxs getDate * wxs getDate
*/ */
export function getDate () { export function getDate () {
const args = Array.prototype.slice.call(arguments) var args = Array.prototype.slice.call(arguments)
args.unshift(Date) args.unshift(Date)
return new (Function.prototype.bind.apply(Date, args))() return new (Function.prototype.bind.apply(Date, args))()
} }
...@@ -122,7 +122,11 @@ export default { ...@@ -122,7 +122,11 @@ export default {
} }
}, },
_resize () { _resize () {
var canvas = this.$refs.canvas
var context = canvas.getContext('2d')
var imageData = context.getImageData(0, 0, canvas.width, canvas.height)
wrapper(this.$refs.canvas) wrapper(this.$refs.canvas)
context.putImageData(imageData, 0, 0)
}, },
_touchmove (event) { _touchmove (event) {
event.preventDefault() event.preventDefault()
......
...@@ -333,8 +333,16 @@ const protocols = { // 需要做转换的 API 列表 ...@@ -333,8 +333,16 @@ const protocols = { // 需要做转换的 API 列表
} }
}, },
getUserInfo: { getUserInfo: {
name: 'getAuthUserInfo', name: my.canIUse('getOpenUserInfo') ? 'getOpenUserInfo' : 'getAuthUserInfo',
returnValue (result) { returnValue (result) {
if (my.canIUse('getOpenUserInfo')) {
let response = {}
try {
response = JSON.parse(result.response).response
} catch (e) {}
result.nickName = response.nickName
result.avatar = response.avatar
}
result.userInfo = { result.userInfo = {
nickName: result.nickName, nickName: result.nickName,
avatarUrl: result.avatar avatarUrl: result.avatar
......
...@@ -23,7 +23,8 @@ export default function parseBaseComponent (vueComponentOptions, { ...@@ -23,7 +23,8 @@ export default function parseBaseComponent (vueComponentOptions, {
const options = { const options = {
multipleSlots: true, multipleSlots: true,
addGlobalClass: true addGlobalClass: true,
...(vueOptions.options || {})
} }
if (__PLATFORM__ === 'mp-weixin' || __PLATFORM__ === 'mp-qq') { if (__PLATFORM__ === 'mp-weixin' || __PLATFORM__ === 'mp-qq') {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册