AuxiliaryRoom.vue 964 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <template>
  2. <div>
  3. <van-button @click='roateX' type='primary'>横屏</van-button>
  4. <van-button @click='roateY' type='primary'>竖屏</van-button>
  5. </div>
  6. </template>
  7. <script>
  8. import Vue from 'vue'
  9. import { Button } from 'vant'
  10. Vue.use(Button)
  11. export default {
  12. name: 'AuxiliaryRoom',
  13. props: {},
  14. components: {},
  15. data() {
  16. return {}
  17. },
  18. beforeMount() {},
  19. mounted() {},
  20. methods: {
  21. roateX() {
  22. console.log('横屏')
  23. webkit.messageHandlers.cordova_iab.postMessage(
  24. JSON.stringify({
  25. method: 'roateX',
  26. })
  27. )
  28. },
  29. // 竖屏
  30. roateY() {
  31. console.log('竖屏')
  32. webkit.messageHandlers.cordova_iab.postMessage(
  33. JSON.stringify({
  34. method: 'roateY',
  35. })
  36. )
  37. },
  38. },
  39. }
  40. </script>
  41. <style lang='less' scoped>
  42. </style>