helloView.uvue 751 字节
Newer Older
lizhongyi_'s avatar
lizhongyi_ 已提交
1
<template>
2 3 4
	<div>
    <button @tap="doSth">调用组件的方法</button>
		<uts-hello-view ref="helloView" buttonText="点击按钮内容" style="width:375px;height: 375px;background-color: aqua;"></uts-hello-view>
5 6
		<uts-hello-container style="flex: 1;background-color: red;">
			<text style="left: 100px;top: 100px;background-color: green;">文本组件</text>
7 8 9
			<image src="../../static/logo.png" mode="aspectFit"></image>
		</uts-hello-container>
	</div>
lizhongyi_'s avatar
lizhongyi_ 已提交
10 11 12 13
	
</template>

<script>
14 15 16 17 18 19 20 21 22 23 24 25 26
export default {
  data() {
    return {
    }
  },
  methods: {
    // 调用组件内的方法
    doSth() {
      // uvue 页面调用方法
      (this.$refs["helloView"] as UtsHelloViewElement).doSth("param doSomething");
    }
  }
}
lizhongyi_'s avatar
lizhongyi_ 已提交
27 28 29 30
</script>

<style>
</style>