Commit da8a014b authored by FuryBean's avatar FuryBean Committed by GitHub

Merge pull request #85 from Leopoldthecoder/next

update message-box, select and slider docs
parents d837afd7 4a6765c2
...@@ -15,12 +15,12 @@ ...@@ -15,12 +15,12 @@
this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', { this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', {
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
this.$msgbox({ this.$notify({
message: '删除成功!', message: '删除成功!',
type: 'success' type: 'success'
}); });
}).catch(() => { }).catch(() => {
this.$msgbox({ this.$notify({
message: '已取消删除', message: '已取消删除',
type: 'info' type: 'info'
}); });
...@@ -31,11 +31,16 @@ ...@@ -31,11 +31,16 @@
this.$prompt('请输入邮箱', '提示', { this.$prompt('请输入邮箱', '提示', {
inputPattern: /[\w!#$%&'*+/=?^_`{|}~-]+(?:\.[\w!#$%&'*+/=?^_`{|}~-]+)*@(?:[\w](?:[\w-]*[\w])?\.)+[\w](?:[\w-]*[\w])?/, inputPattern: /[\w!#$%&'*+/=?^_`{|}~-]+(?:\.[\w!#$%&'*+/=?^_`{|}~-]+)*@(?:[\w](?:[\w-]*[\w])?\.)+[\w](?:[\w-]*[\w])?/,
inputErrorMessage: '邮箱格式不正确' inputErrorMessage: '邮箱格式不正确'
}).then(({ value, action }) => { }).then(({ value }) => {
console.log('action: ', action); this.$notify({
this.$msgbox('', '你的邮箱是: ' + value); type: 'success',
message: '你的邮箱是: ' + value
});
}).catch(() => { }).catch(() => {
this.$msgbox('', '取消输入'); this.$notify({
type: 'info',
messgae: '取消输入'
});
}); });
}, },
...@@ -46,7 +51,10 @@ ...@@ -46,7 +51,10 @@
message: '这是一段内容, 这是一段内容, 这是一段内容, 这是一段内容, 这是一段内容, 这是一段内容, 这是一段内容', message: '这是一段内容, 这是一段内容, 这是一段内容, 这是一段内容, 这是一段内容, 这是一段内容, 这是一段内容',
showCancelButton: true showCancelButton: true
}).then(action => { }).then(action => {
this.$msgbox('', 'action: ' + action); this.$notify({
type: 'info',
message: 'action: ' + action
});
}); });
} }
...@@ -124,12 +132,14 @@ MessageBox 组件也拥有极高的定制性,我们可以传入`options`作为 ...@@ -124,12 +132,14 @@ MessageBox 组件也拥有极高的定制性,我们可以传入`options`作为
this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', { this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', {
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
this.$alert('删除成功!',{ this.$notify({
type: 'success' type: 'success',
message: '删除成功!'
}); });
}).catch(() => { }).catch(() => {
this.$alert('已取消删除', { this.$notify({
type: 'info' type: 'info',
message: '已取消删除'
}); });
}); });
}, },
...@@ -157,9 +167,15 @@ Prompt 框功能强大,可以处理简单的输入,甚至你可以用`inputP ...@@ -157,9 +167,15 @@ Prompt 框功能强大,可以处理简单的输入,甚至你可以用`inputP
inputPattern: /[\w!#$%&'*+/=?^_`{|}~-]+(?:\.[\w!#$%&'*+/=?^_`{|}~-]+)*@(?:[\w](?:[\w-]*[\w])?\.)+[\w](?:[\w-]*[\w])?/, inputPattern: /[\w!#$%&'*+/=?^_`{|}~-]+(?:\.[\w!#$%&'*+/=?^_`{|}~-]+)*@(?:[\w](?:[\w-]*[\w])?\.)+[\w](?:[\w-]*[\w])?/,
inputErrorMessage: '邮箱格式不正确' inputErrorMessage: '邮箱格式不正确'
}).then(value => { }).then(value => {
this.$alert('你的邮箱是: ' + value); this.$notify({
type: 'success',
message: '你的邮箱是: ' + value
});
}).catch(() => { }).catch(() => {
this.$alert('取消输入'); this.$notify({
type: 'info',
message: '取消输入'
});
}); });
} }
} }
...@@ -187,7 +203,10 @@ Msgbox 框是最基本的弹框,与 Alert 的区别在于 Alert 无法通过 E ...@@ -187,7 +203,10 @@ Msgbox 框是最基本的弹框,与 Alert 的区别在于 Alert 无法通过 E
message: '这是一段内容, 这是一段内容, 这是一段内容, 这是一段内容, 这是一段内容, 这是一段内容, 这是一段内容', message: '这是一段内容, 这是一段内容, 这是一段内容, 这是一段内容, 这是一段内容, 这是一段内容, 这是一段内容',
showCancelButton: true showCancelButton: true
}).then(action => { }).then(action => {
this.$alert('action: ' + action); this.$notify({
type: 'info',
message: 'action: ' + action
});
}); });
}, },
} }
......
This diff is collapsed.
...@@ -10,11 +10,6 @@ ...@@ -10,11 +10,6 @@
value6: null, value6: null,
value7: null value7: null
}; };
},
methods: {
onChange(value) {
console.log(value);
}
} }
} }
</script> </script>
...@@ -67,27 +62,6 @@ ...@@ -67,27 +62,6 @@
<el-slider show-input v-model="value6"></el-slider> <el-slider show-input v-model="value6"></el-slider>
``` ```
## 回调函数
<el-slider @change="onChange" v-model="value7"></el-slider>
```html
<template>
<el-slider @change="onChange"></el-slider>
</template>
<script>
export default {
methods: {
onChange(value) {
console.log(value);
}
}
}
</script>
```
## API ## API
| 参数 | 说明 | 类型 | 可选值 | 默认值 | | 参数 | 说明 | 类型 | 可选值 | 默认值 |
|---------- |-------------- |---------- |-------------------------------- |-------- | |---------- |-------------- |---------- |-------------------------------- |-------- |
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment