voice.vue 891 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <script>
  2. export default {
  3. name: "lemonMessageVoice",
  4. inheritAttrs: false,
  5. inject: ["IMUI"],
  6. data() {
  7. return {
  8. };
  9. },
  10. created() {
  11. },
  12. render() {
  13. return (
  14. <lemon-message-basic
  15. class="lemon-message-voice"
  16. props={{ ...this.$attrs }}
  17. scopedSlots={{
  18. content: props => {
  19. return this.renderHtml(props);
  20. }
  21. }}
  22. />
  23. );
  24. },
  25. methods: {
  26. renderHtml(data){
  27. return <audio block="true" showDuration='false' duration={data.duration} controls src={data.content} ></audio>;
  28. // return <span>{props.content}&nbsp;🔈</span>;
  29. }
  30. }
  31. };
  32. </script>
  33. <style lang="stylus">
  34. .lemon-message.lemon-message-voice
  35. user-select none
  36. .lemon-message__content
  37. border 0px solid #000
  38. font-size 12px
  39. cursor pointer
  40. &::before
  41. display none
  42. </style>