提交 27c8c074 编写于 作者: Q qiang

Merge branch 'dev' into 0.7.0

# Conflicts:
#	packages/uni-h5/package.json
...@@ -90,6 +90,10 @@ export const showLoading = { ...@@ -90,6 +90,10 @@ export const showLoading = {
visible: { visible: {
type: Boolean, type: Boolean,
default: true default: true
},
isShowLoading: {
type: Boolean,
default: true
} }
} }
......
...@@ -27,7 +27,7 @@ export function showLoading (args) { ...@@ -27,7 +27,7 @@ export function showLoading (args) {
} }
export function hideLoading () { export function hideLoading () {
emit('onHideToast') emit('onHideLoading')
return {} return {}
} }
......
...@@ -6,7 +6,7 @@ export function callAppHook (vm, hook, params) { ...@@ -6,7 +6,7 @@ export function callAppHook (vm, hook, params) {
if (hook !== 'onError') { if (hook !== 'onError') {
console.debug(`App:${hook} have been invoked` + (params ? ` ${JSON.stringify(params)}` : '')) console.debug(`App:${hook} have been invoked` + (params ? ` ${JSON.stringify(params)}` : ''))
} }
return callHook(vm, hook, params) return vm.__call_hook(hook, params)
} }
export function callPageHook (vm, hook, params) { export function callPageHook (vm, hook, params) {
......
...@@ -11,8 +11,7 @@ ...@@ -11,8 +11,7 @@
v-show="showTabBar" v-show="showTabBar"
v-bind="tabBar" /> v-bind="tabBar" />
<toast <toast
v-bind="showToast" v-bind="showToast"/>
@close="_onModalClose" />
<action-sheet <action-sheet
v-bind="showActionSheet" v-bind="showActionSheet"
@close="_onActionSheetClose" /> @close="_onActionSheetClose" />
......
...@@ -8,14 +8,30 @@ export default { ...@@ -8,14 +8,30 @@ export default {
}, },
created () { created () {
UniServiceJSBridge.on('onShowToast', args => { UniServiceJSBridge.on('onShowToast', args => {
setTimeout(() => { // 延迟一下 show 可解决窗口打开前调用 showToast,showLoading 在 onHidePopup 之后触发 setTimeout(() => { // 延迟一下 show 可解决窗口打开前调用 showToast 在 onHidePopup 之后触发
this.showToast = args this.showToast = args
}, 10) }, 10)
}) })
UniServiceJSBridge.on(['onHidePopup', 'onHideToast'], args => {
setTimeout(() => { // 与 show 对应延迟10ms,避免快速调用 show,hide 导致无法关闭 const createOnHide = (type) => {
this.showToast.visible = false return () => {
}, 10) let warnMsg = ''
}) if (type === 'onHideToast' && this.showToast.isShowLoading) {
warnMsg = '请注意 showToast 与 hideToast 必须配对使用'
} else if (type === 'onHideLoading' && !this.showToast.isShowLoading) {
warnMsg = '请注意 showLoading 与 hideLoading 必须配对使用'
}
if (warnMsg) {
return console.warn(warnMsg)
}
setTimeout(() => { // 与 show 对应延迟10ms,避免快速调用 show,hide 导致无法关闭
this.showToast.visible = false
}, 10)
}
}
UniServiceJSBridge.on('onHidePopup', createOnHide('onHidePopup'))
UniServiceJSBridge.on('onHideToast', createOnHide('onHideToast'))
UniServiceJSBridge.on('onHideLoading', createOnHide('onHideLoading'))
} }
} }
...@@ -113,7 +113,7 @@ export default { ...@@ -113,7 +113,7 @@ export default {
font-size: 18px; font-size: 18px;
word-wrap:break-word; word-wrap:break-word;
word-break:break-all; word-break:break-all;
white-space: pre; white-space: pre-wrap;
overflow : hidden; overflow : hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
display: -webkit-box; display: -webkit-box;
...@@ -128,7 +128,7 @@ export default { ...@@ -128,7 +128,7 @@ export default {
line-height: 1.4; line-height: 1.4;
word-wrap: break-word; word-wrap: break-word;
word-break: break-all; word-break: break-all;
white-space: pre; white-space: pre-wrap;
color: #999999; color: #999999;
max-height: 400px; max-height: 400px;
overflow-y: auto; overflow-y: auto;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册