helloView.uvue 657 字节
Newer Older
lizhongyi_'s avatar
lizhongyi_ 已提交
1
<template>
2 3 4 5 6 7 8 9
	<div>
    <button @tap="doSth">调用组件的方法</button>
		<uts-hello-view ref="helloView" buttonText="点击按钮内容" style="width:375px;height: 375px;background-color: aqua;"></uts-hello-view>
		<uts-hello-container>
			<text>文本组件</text>
			<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 27
export default {
  data() {
    return {

    }
  },
  methods: {
    // 调用组件内的方法
    doSth() {
      // uvue 页面调用方法
      (this.$refs["helloView"] as UtsHelloViewElement).doSth("param doSomething");
    }
  }
}
lizhongyi_'s avatar
lizhongyi_ 已提交
28 29 30 31
</script>

<style>
</style>