Skip to content

Commit

Permalink
fix: user avatar upload example error
Browse files Browse the repository at this point in the history
see: #426
  • Loading branch information
qiqingfu committed Nov 28, 2020
1 parent a0886c8 commit dd4e04a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions examples/docs/zh-CN/upload.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,10 @@

<script>
import { ref } from 'vue';
import { useMessage } from 'element3';
export default {
setup(){
const message = useMessage();
const imageUrl = ref('');
const handleAvatarSuccess = (res, file) => {
Expand All @@ -111,10 +113,10 @@
const isLt2M = file.size / 1024 / 1024 < 2;
if (!isJPG) {
self.$message.error('上传头像图片只能是 JPG 格式!');
message.error('上传头像图片只能是 JPG 格式!');
}
if (!isLt2M) {
self.$message.error('上传头像图片大小不能超过 2MB!');
message.error('上传头像图片大小不能超过 2MB!');
}
return isJPG && isLt2M;
}
Expand Down

0 comments on commit dd4e04a

Please sign in to comment.