提交 cb0c3123 编写于 作者: 郭胜强

Merge branch 'master' into dev

{
"name": "@dcloudio/uni-h5",
"version": "0.0.10",
"version": "0.0.11",
"description": "uni-app h5",
"main": "dist/index.umd.min.js",
"scripts": {
......
......@@ -3,11 +3,25 @@ import {
} from '../util'
import createPage from './create-page'
// 与小程序保持一致,尝试decodeURIComponent一次参数
function getDecodedQuery (query = {}) {
const decodedQuery = {}
Object.keys(query).forEach(name => {
try {
decodedQuery[name] = decodeURIComponent(query[name])
} catch (e) {
decodedQuery[name] = query[name]
}
})
return decodedQuery
}
export function createPageMixin () {
return {
created: function pageCreated () {
createPage(this)
callPageHook(this, 'onLoad', this.$route.query)
callPageHook(this, 'onLoad', getDecodedQuery(this.$route.query))
callPageHook(this, 'onShow')
}
}
......
......@@ -9,7 +9,7 @@ let imageInput = null
const _createInput = function (options) {
let inputEl = document.createElement('input')
inputEl.type = 'file'
inputEl.style = 'visibility: hidden;z-index: -999;width: 0;height: 0;'
inputEl.style = 'position: absolute;visibility: hidden;z-index: -999;width: 0;height: 0;'
inputEl.accept = 'image/*'
if (options.count > 1) {
inputEl.multiple = 'multiple'
......
......@@ -9,7 +9,7 @@ let videoInput = null
const _createInput = function (options) {
let inputEl = document.createElement('input')
inputEl.type = 'file'
inputEl.style = 'visibility: hidden;z-index: -999;width: 0;height: 0;'
inputEl.style = 'position: absolute;visibility: hidden;z-index: -999;width: 0;height: 0;'
inputEl.accept = 'video/*'
// 经过测试,仅能限制只通过相机拍摄,不能限制只允许从相册选择。
if (options.sourceType.length === 1 && options.sourceType[0] === 'camera') {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册