diff --git a/README.md b/README.md index 65473b7a..bfedde51 100644 --- a/README.md +++ b/README.md @@ -147,6 +147,9 @@ export default { // called when the user scrolls message list to top // leverage pagination for loading another page of messages }, + downloadMessage(message) { + console.log('Try to download the file') + }, handleOnType () { console.log('Emit typing event') }, @@ -195,6 +198,7 @@ For more detailed examples see the demo folder. |-----|--------|---------------| | onType | undefined | Fires when user types on the message input | | edit | `message` | Fires after user edited message | +| download | `message` | Download file only if document type is file | #### Slots @@ -284,8 +288,47 @@ Message objects are rendered differently depending on their type. Currently, onl } } } + +{ + author: 'me', + type: 'file', + id: 1, // or text '1' + isEdited: false, + data: { + file: { + id: 1, + mime: 'image/png', + name: 'test.png', + size: 588147, + meta: '06-16-2019 12:45' + } + } +} + ``` +##### File type messages + +Custom file icons based on mime: + +WORD file + +PDF file + +EXCEL file + +POWER POINT file + +ZIP file + +JPG/JPEG file + +PNG file + +SVG file + +CSV file +For file types other than the above, the default icon is displayed ... #### Quick replies diff --git a/demo/src/App.vue b/demo/src/App.vue index f2ec2300..b9a66708 100644 --- a/demo/src/App.vue +++ b/demo/src/App.vue @@ -4,7 +4,7 @@ :chosenColor="chosenColor" :colors="colors" /> - -