update validator

This commit is contained in:
Harvey Zack committed 2019-06-26 16:34:30 +08:00
1 parent b5cde4d611
commit d6e9643220
5 files changed
+8 -8

No files matched your search

+1 -1
View File
@@ -25,7 +25,7 @@
"homepage": "https://github.com/zhw2590582/ArtPlayer#readme",
"dependencies": {
"balloon-css": "^1.0.0",
"option-validator": "^1.1.1",
"option-validator": "^1.1.2",
"screenfull": "^4.2.0"
}
}
+2 -2
View File
@@ -1,6 +1,6 @@
import { errorHandle } from '../utils';
function validElement(paths, value, type) {
function validElement(value, type, paths) {
return errorHandle(
type === 'string' || value instanceof Element,
`${paths.join('.')} require 'string' or 'Element' type`,
@@ -93,7 +93,7 @@ export default {
style: 'object',
click: 'function',
mounted: 'function',
position: (paths, value) => {
position: (value, type, paths) => {
const position = ['top', 'left', 'right'];
return errorHandle(
position.includes(value),