<template>
  <view class="hello" >
    <input type="text" v-model="text" class="edittext"/>
    <button @click="sendName" type="primary"  style="margin-top: 20rpx">发送名称</button>
  </view>
</template>

<script>

export default {
  props: {},
  data: () => ({
    text:''
  }),
  computed: {},
  methods: {
    sendName(){
      uni.$emit('updateName',this.text)
    }

  },
  watch: {},

  // 组件周期函数--监听组件挂载完毕
  mounted() {},

  // 组件周期函数--监听组件激活(显示)
  activated() {},
  // 组件周期函数--监听组件停用(隐藏)
  deactivated() {},
  // 组件周期函数--监听组件销毁之前
  beforeDestroy() {},
};
</script>

<style>
	.edittext {
		display: flex;
		border: 1rpx solid #333333;
	}
</style>
