提交 7d9ec54a 编写于 作者: Q qiang

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

......@@ -104,8 +104,8 @@ function updateForIterator (el, state) {
function updateForEleId (el, state) {
updateForIterator(el, state)
if (el.for) {
const it = el.$parentIterator3 ? (el.$parentIterator3 + '+' + el.iterator3) : el.iterator3
if (el.for) {
const it = el.$parentIterator3 ? (el.$parentIterator3 + '+' + "'-'" + '+' + el.iterator3) : el.iterator3
updateEleId(el, it, state)
}
}
......
......@@ -250,6 +250,9 @@ module.exports = (api, options) => {
isFirstCompile = false
if (!isProduction) {
if (process.UNI_CLOUD_TCB) {
console.warn(`当前项目使用了腾讯云云服务空间,需在uniCloud后台开启匿名登录,详见:https://uniapp.dcloud.io/uniCloud/authentication?id=auth-anonymously`)
}
if (process.UNI_CLOUD) {
console.warn(`当前项目使用了uniCloud,为避免云函数调用跨域问题,建议在HBuilderX内置浏览器里调试,如使用外部浏览器需处理跨域,详见:https://uniapp.dcloud.io/uniCloud/quickstart?id=useinh5`)
}
......
......@@ -4,6 +4,7 @@ const mkdirp = require('mkdirp')
const loaderUtils = require('loader-utils')
process.UNI_CLOUD = false
process.UNI_CLOUD_TCB = false
process.UNI_CLOUD_ALIYUN = false
process.env.UNI_CLOUD_PROVIDER = JSON.stringify({})
......@@ -12,6 +13,7 @@ if (process.env.UNI_CLOUD_SPACES) {
const spaces = JSON.parse(process.env.UNI_CLOUD_SPACES)
if (Array.isArray(spaces)) {
process.UNI_CLOUD = spaces.length > 0
process.UNI_CLOUD_TCB = !!spaces.find(space => !space.clientSecret)
process.UNI_CLOUD_ALIYUN = !!spaces.find(space => space.clientSecret)
if (spaces.length === 1) {
const space = spaces[0]
......
......@@ -92,7 +92,9 @@ function showTabBar (animation) {
tabBar && tabBar.showTabBar({
animation
})
}
}
let maskClickCallback = []
export default {
id: '0',
......@@ -104,7 +106,12 @@ export default {
tabBar = requireNativePlugin('uni-tabview')
} catch (error) {
console.log(`uni.requireNativePlugin("uni-tabview") error ${error}`)
}
}
tabBar.onMaskClick(() => {
maskClickCallback.forEach((callback) => {
callback()
})
})
tabBar && tabBar.onClick(({ index }) => {
clickCallback(config.list[index], index)
})
......@@ -170,7 +177,11 @@ export default {
color: mask
})
},
addEventListener (name, callback) {
tabBar.onMaskClick(callback)
addEventListener (name, callback) {
maskClickCallback.push(callback)
},
removeEventListener (name, callback) {
let callbackIndex = maskClickCallback.indexOf(callback)
maskClickCallback.splice(callbackIndex, 1)
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册