App.vue 1008 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <template>
  2. <div id="app" @mousewheel.stop @touchstart.stop>
  3. <chat-mini
  4. :show="show"
  5. :groupId="groupId"
  6. :width="outWidth"
  7. :height="outHeight"
  8. >
  9. </chat-mini>
  10. </div>
  11. </template>
  12. <script>
  13. import { mapActions, mapMutations } from 'vuex'
  14. import { getUrlParam } from '@/util/util'
  15. import chatMini from '@/components/chatMini/chatMini'
  16. export default {
  17. name: 'App',
  18. components: {
  19. chatMini
  20. },
  21. data () {
  22. var width = getUrlParam('width') || window.innerWidth
  23. var height = getUrlParam('height') || window.innerHeight - 16
  24. return {
  25. show: getUrlParam('show') === 'true',
  26. groupId: getUrlParam('groupId') || 10001,
  27. outWidth: parseInt(width),
  28. outHeight: parseInt(height)
  29. }
  30. },
  31. methods: {
  32. ...mapMutations([
  33. 'setPublicKey',
  34. 'setShowLoginTyps'
  35. ]),
  36. ...mapActions([
  37. 'setScatter',
  38. 'setAccount'
  39. ])
  40. },
  41. created () {
  42. }
  43. }
  44. </script>
  45. <style lang="scss">
  46. @import '@/style/mini.scss';
  47. </style>