<script setup>
/**
 * name：子父组件通信 子组件
 * user：sa0ChunLuyu
 * date：2022-04-13 11:14:00
 */
const $emit = defineEmits(['faFunc'])
const $props = defineProps({
  fa_value: {
    type: String,
    default: ''
  }
})
const son_value = ref('son_value')
const sonFunc = () => {
  console.log('sonFunc')
}
defineExpose({
  son_value,
  sonFunc
})
</script>
<template>
  <tr>
    <td>
      <n-input disabled v-model:value="$props.fa_value"></n-input>
      <n-input mt-1 v-model:value="son_value"></n-input>
    </td>
    <td>
      <n-button secondary strong @click="$emit('faFunc')">
        父函数
      </n-button>
    </td>
  </tr>
</template>
