<template>
  <view class="form-row" @click="handleClick">
    <view class="form-row__label">
      {{ name }}<text v-if="required" class="form-cell-required">*</text>
    </view>
    <view class="form-row__content">
      <slot></slot>
    </view>
  </view>
</template>

<script setup>
const emit = defineEmits(['click'])

defineProps({
  name: {
    default: ''
  },
  required: {
    type: Boolean,
    default: false
  },
  title: {
    default: ''
  }
})

function handleClick(e) {
  emit('click', e)
}
</script>
<style>
@import url(./cell-style.css);
</style>
