<template>
	<u-button type="primary" hover-class="button-hover" @click="send">
		发消息
	</u-button>
</template>

<script lang="ts" setup>
import { onLoad } from '@dcloudio/uni-app'

onLoad(() => {

	document.addEventListener('UniAppJSBridgeReady', () => {
		console.log(uni);

	}, false)

})

function send() {

	window.postMessage('hello', '*')
	// uni.postMessage({
	// 	data: { action: "msg ok" }
	// })
}
</script>
