Skip to content

Commit 81a44a0

Browse files
committed
perf: fix eslint warning
1 parent c1ce240 commit 81a44a0

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

src/components/ImageCropper/index.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,8 @@ export default {
248248
// 浏览器是否支持该控件
249249
isSupported,
250250
// 浏览器是否支持触屏事件
251-
isSupportTouch: document.hasOwnProperty('ontouchstart'),
251+
252+
isSupportTouch: Object.prototype.hasOwnProperty.call(document, 'ontouchstart'),
252253
// 步骤
253254
step: 1, // 1选择文件 2剪裁 3上传
254255
// 上传状态及进度

src/store/modules/settings.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ const state = {
1313

1414
const mutations = {
1515
CHANGE_SETTING: (state, { key, value }) => {
16-
if (state.hasOwnProperty(key)) {
16+
// https://eslint.org/docs/rules/no-prototype-builtins
17+
if (Object.prototype.hasOwnProperty.call(state, key)) {
1718
state[key] = value
1819
}
1920
}

src/store/modules/user.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ const actions = {
104104

105105
// dynamically modify permissions
106106
changeRoles({ commit, dispatch }, role) {
107+
// eslint-disable-next-line
107108
return new Promise(async resolve => {
108109
const token = role + '-token'
109110

0 commit comments

Comments
 (0)