extend-popup.vue 735 B

1234567891011121314151617181920212223242526272829303132333435
  1. <template>
  2. <cube-popup type="extend-popup" ref="popup">
  3. <div class="cube-extend-popup-content" @click="hide">
  4. <slot>{{content}}</slot>
  5. </div>
  6. </cube-popup>
  7. </template>
  8. <script type="text/ecmascript-6">
  9. const COMPONENT_NAME = 'cube-extend-popup'
  10. export default {
  11. name: COMPONENT_NAME,
  12. props: {
  13. content: {
  14. type: String
  15. }
  16. },
  17. methods: {
  18. show() {
  19. this.$refs.popup.show()
  20. },
  21. hide() {
  22. this.$refs.popup.hide()
  23. this.$emit('hide')
  24. }
  25. }
  26. }
  27. </script>
  28. <style lang="stylus" rel="stylesheet/stylus">
  29. .cube-extend-popup
  30. .cube-extend-popup-content
  31. padding: 20px
  32. color: #fff
  33. background-color: rgba(0, 0, 0, .8)
  34. </style>