dcloudio / dcloudio/mui

SvgAnimatedString missing method indexOf

Open
#90 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
13.5k
Forks
6.5k
PR merge metrics
No merged PRs in 30d

Description

在界面中使用svg图形时,当点击或是滑动界面的时候提示错误
SvgAnimatedString has no method indexOf
经过跟踪代码定位到在mui.js大约1325行

```
}(mui, window, document, "offcanvas"), function (a, b) {
var c = "mui-action", d = function (a, b) {
return b.className && ~b.className.indexOf(c) ? (a.preventDefault(), b) : !1
};
a.registerTarget({name: b, index: 50, handle: d, target: !1, isContinue: !0})
```

b.className为SvgAnimatedString类型,但是这个类型没有indexOf方法,将代码改为

```
}(mui, window, document, "offcanvas"), function (a, b) {
var c = "mui-action", d = function (a, b) {
return b.className &&b.className.indexOf&& ~b.className.indexOf(c) ? (a.preventDefault(), b) : !1
};
a.registerTarget({name: b, index: 50, handle: d, target: !1, isContinue: !0})
```

这样就不会报错了

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.