videoDialog.vue 868 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <template>
  2. <!-- 视频播放弹窗 -->
  3. <el-dialog
  4. :title="title"
  5. :visible.sync="show"
  6. @close="closeVideoDialog"
  7. class="course-video-dialog"
  8. center>
  9. <video controls :src="source" class="course-video-box"></video>
  10. <p v-if="footerText">{{footerText}}</p>
  11. </el-dialog>
  12. </template>
  13. <script>
  14. export default {
  15. name: "videoDialog",
  16. props: {
  17. source: {
  18. type: String,
  19. require: true
  20. },
  21. footerText: {
  22. type: String,
  23. },
  24. visible: {
  25. type: Boolean,
  26. require: true
  27. }
  28. },
  29. data() {
  30. return {
  31. title: '',
  32. show: false,
  33. }
  34. },
  35. watch: {
  36. visible: {
  37. handler(newVal) {
  38. this.show = newVal;
  39. },
  40. immediate: true
  41. }
  42. },
  43. methods: {
  44. closeVideoDialog() {
  45. this.$emit('update:visible',this.show)
  46. }
  47. }
  48. }
  49. </script>
  50. <style scoped>
  51. </style>