提交 1f134763 编写于 作者: Q qiang

Merge branch 'dev' into alpha

......@@ -31,7 +31,6 @@ export function normalizeDataset (dataset = {}) {
const len = key.length
if (key.substr(0, 1) === 'v' && (len === 9 || len === 10)) {
delete result[key]
break
}
}
}
......@@ -41,13 +40,28 @@ export function normalizeDataset (dataset = {}) {
export function getTargetDataset (target) {
let dataset = {}
if (target.__vue__) {
const $attrs = target.__vue__.$attrs
const vm = target.__vue__
function updateDataset (vm, force) {
const $attrs = vm.$attrs
for (const key in $attrs) {
if (key.startsWith('data-')) {
dataset[camelize(key.substr(5))] = $attrs[key]
const newKey = camelize(key.substr(5))
const value = $attrs[key]
dataset[newKey] = force ? value : dataset[newKey] || value
}
}
}
if (vm) {
let $child = vm
while ($child && $child.$el === target) {
updateDataset($child)
$child = $child.$children[0]
}
let $parent = vm.$parent
while ($parent && $parent.$el === target) {
updateDataset($parent, true)
$parent = $parent.$parent
}
} else {
dataset = target.dataset || {}
}
......
......@@ -109,7 +109,8 @@ export function createRequestTaskById (requestTaskId, {
ok,
status,
data,
headers
headers,
errorMsg
}) => {
if (aborted) {
return
......@@ -127,12 +128,16 @@ export function createRequestTaskById (requestTaskId, {
header: headers,
cookies: cookiesPrase(headers)
})
} else {
} else {
let errMsg = 'abort statusCode:' + statusCode
if (errorMsg) {
errMsg = errMsg + ' ' + errorMsg
}
publishStateChange({
requestTaskId,
state: 'fail',
statusCode,
errMsg: 'abort statusCode:' + statusCode
errMsg
})
}
})
......
......@@ -33,6 +33,8 @@ export function hookKeyboardEvent (event, callback) {
onMethod('onKeyboardHeightChange', res => {
keyboardHeight = res.height
if (keyboardHeight > 0) {
onKeyboardShow && onKeyboardShow()
const callback = onKeyboardShow
onKeyboardShow = null
callback && callback()
}
})
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册