The input element's type ('number') does not support selection

fastclick.js?bf9a:331 Uncaught DOMException: Failed to execute 'setSelectionRange' on 'HTMLInputElement': The input element's type ('number') does not support selectionnode

解决方法:code

找到node_module中的文件fastclick.js, line: 327 将ip

if (deviceIsIOS && targetElement.setSelectionRange && targetElement.type.indexOf('date') !== 0 && targetElement.type !== 'time' && targetElement.type !== 'month') {
            length = targetElement.value.length;
            targetElement.setSelectionRange(length, length);
        } else {
            targetElement.focus();
    }

替换为:element

var useSelectionRange = deviceIsIOS;
    if(useSelectionRange){
        try{
            length = targetElement.value.length;
            targetElement.setSelectionRange(length, length);
        }catch(error){
            useSelectionRange = false;
        }
    }
    if (!useSelectionRange) {
        targetElement.focus();
    }