perf: fix eslint warning

This commit is contained in:
花裤衩 2019-10-09 21:12:03 +08:00
parent c1ce24081e
commit 81a44a0284
3 changed files with 5 additions and 2 deletions

View File

@ -248,7 +248,8 @@ export default {
//
isSupported,
//
isSupportTouch: document.hasOwnProperty('ontouchstart'),
isSupportTouch: Object.prototype.hasOwnProperty.call(document, 'ontouchstart'),
//
step: 1, // 1 2 3
//

View File

@ -13,7 +13,8 @@ const state = {
const mutations = {
CHANGE_SETTING: (state, { key, value }) => {
if (state.hasOwnProperty(key)) {
// https://eslint.org/docs/rules/no-prototype-builtins
if (Object.prototype.hasOwnProperty.call(state, key)) {
state[key] = value
}
}

View File

@ -104,6 +104,7 @@ const actions = {
// dynamically modify permissions
changeRoles({ commit, dispatch }, role) {
// eslint-disable-next-line
return new Promise(async resolve => {
const token = role + '-token'