Skip to content

Commit 39e78e2

Browse files
author
lin-xin
committed
修改配置文档
1 parent 86c1612 commit 39e78e2

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ or
2727
import 'vue2-toast/lib/toast.css';
2828
import Toast from 'vue2-toast';
2929
Vue.use(Toast, {
30-
defaultType: 'center',
30+
type: 'center',
3131
duration: 3000,
3232
wordWrap: true,
3333
width: '150px'
@@ -87,7 +87,7 @@ build: {
8787

8888
Vue.use(Toast, [options])
8989

90-
- defaultType : position of Toast. | String | default: 'bottom' | possible 'top, center,bottom'
90+
- type : position of Toast. | String | default: 'bottom' | possible 'top, center,bottom'
9191
- duration : Number | default 2500ms
9292
- wordWrap : word wrap. | Boolean | default: false
9393
- width : width of Toast. | String | default: 'auto'

README_zh.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Vue.use(Toast);
2828
import 'vue2-toast/lib/toast.css';
2929
import Toast from 'vue2-toast';
3030
Vue.use(Toast, {
31-
defaultType: 'center',
31+
type: 'center',
3232
duration: 3000,
3333
wordWrap: true,
3434
width: '150px'
@@ -88,7 +88,7 @@ build: {
8888

8989
Vue.use(Toast, [options])
9090

91-
- defaultType : Toast 的位置. | String | 默认: 'bottom' | 可选值 'top, center,bottom'
91+
- type : Toast 的位置. | String | 默认: 'bottom' | 可选值 'top, center,bottom'
9292
- duration : Number | 默认 2500ms
9393
- wordWrap : 是否自动换行. | Boolean | 默认: false
9494
- width : Toast 的宽度. | String | 默认: 'auto'

lib/index.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1-
/**
2-
* Updated by linxin on 2017/7/27.
1+
/*
2+
* @Author: linxin
3+
* @Date: 2017-07-27
4+
* @Last Modified time: 2018-07-31 11:46:52
35
*/
6+
47
var Toast = {};
58
var toastTimer = false, // 存储toast定时器id
69
toastVM = null, // 存储toast vm
@@ -19,7 +22,7 @@ Toast.install = function (Vue, options) {
1922
opt[property] = options[property];
2023
}
2124
Vue.prototype.$toast = function (tip, config) {
22-
let options = JSON.parse(JSON.stringify(opt));
25+
var options = JSON.parse(JSON.stringify(opt));
2326
if(typeof config === 'object'){
2427
for (var property in config) {
2528
options[property] = config[property];

0 commit comments

Comments
 (0)