可能情况 1: 检查是否使用了 FastClick, 如果使用了在 main.JS 中增加以下代码即可.
- FastClick.attach(document.body);
- FastClick.prototype.focus = function (targetElement) {
- let length;
- if (targetElement.setSelectionRange && targetElement.type.indexOf('date') !== 0 && targetElement.type !== 'time' && targetElement.type !== 'month') {
- length = targetElement.value.length;
- targetElement.focus();
- targetElement.setSelectionRange(length, length);
- } else {
- targetElement.focus();
- }
- }
可能情况 2:App.vue 中设置了 - webkit-user-select: none; 影响到了 input, 解决方法:
- *:not(input,textarea), *:before:not(input,textarea), *:after:not(input,textarea) {
- -webkit-user-select: none;
- }
来源: http://www.jianshu.com/p/053454429e0d