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

+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),