Skip to content

Commit

Permalink
Update imgZoom.js
Browse files Browse the repository at this point in the history
修复inStr函数的类型问题
  • Loading branch information
lixianbin1 authored Mar 20, 2024
1 parent 3ae5ed0 commit ed61f35
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/imgZoom.js
Original file line number Diff line number Diff line change
@@ -227,10 +227,13 @@ function bing(){
//判断class字符串是否存在imgzoom
function inStr(str, string) {
var isin = false;
var arr = str.split(' ');
for (var i in arr) {
if (arr[i] == string) {
isin = true;
if (typeof str === "string") {
var arr = str.split(' ');
for (var i in arr) {
if (arr[i] === string) {
isin = true;
break;
}
}
}
return isin;
@@ -411,4 +414,4 @@ var imgZoom = function(){
};
}();

export default imgZoom
export default imgZoom

0 comments on commit ed61f35

Please sign in to comment.