Skip to content

Commit e777299

Browse files
committed
added string includes polyfill
fixed : #74
1 parent a3a2f8c commit e777299

File tree

3 files changed

+36
-1
lines changed

3 files changed

+36
-1
lines changed

dist/vue-toasted.js

Lines changed: 17 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/vue-toasted.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/js/show.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,24 @@ import animations from './animations'
33
import {toastObject} from './object'
44
const uuid = require('shortid');
55

6+
// string includes polyfill
7+
if (!String.prototype.includes) {
8+
Object.defineProperty(String.prototype, 'includes', {
9+
value: function(search, start) {
10+
if (typeof start !== 'number') {
11+
start = 0
12+
}
13+
14+
if (start + search.length > this.length) {
15+
return false
16+
} else {
17+
return this.indexOf(search, start) !== -1
18+
}
19+
}
20+
})
21+
}
22+
23+
624
let _options = {};
725
let _instance = null;
826
/**

0 commit comments

Comments
 (0)