| 123456789101112131415161718192021222324252627282930313233343536373839 |
- <template>
- <view id="test2">
- <button @click="postMessage">发送2</button>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- str: 'hahaha'
- }
- },
- onLoad() {
- },
- methods: {
- postMessage() {
- window.parent.postMessage({
- cmd: 'jump2',
- params: {
- val: 1
- }
- },'*')
- },
- },
- }
- </script>
- <style>
- #test2 {
- width: 300rpx;
- height: 100rpx;
- background-color: #55aaff;
- }
- #test2 button{
- color: blue;
- }
- </style>
|