Skip to content

Commit

Permalink
fix(taro-h5): vibrate异常修复 (#4113)
Browse files Browse the repository at this point in the history
  • Loading branch information
guxingke201 authored and luckyadam committed Aug 12, 2019
1 parent 283f448 commit e234b36
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/taro-h5/src/api/vibrate/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
import { successHandler, errorHandler } from '../utils/index'

const vibrator = window.navigator.vibrate
const vibrator = function vibrator (mm) {
try {
return window.navigator.vibrate(mm)
} catch (e) {
console.log('当前浏览器不支持vibrate')
}
}

/**
* 使手机发生较短时间的振动(15 ms)。仅在 iPhone 7 / 7 Plus 以上及 Android 机型生效
Expand Down

0 comments on commit e234b36

Please sign in to comment.