<template>
  <div class="za-link weui-cell_access" @click="onItemClick">
    <za-text class="link-text" :formModel="formModel" :index="index" :name="name"></za-text>
    <div v-if="!formModel.rules.hiddenArrow" class="weui-cell__ft"></div>
  </div>
</template>
<script>
import base from '../mixin/base-mixin'
import zaText from '../text'
export default {
  name: 'za-link',
  components:{
    zaText
  },
  mixins: [base],
  props: {
    formModel: Object,
    index: [String, Number],
    name: String, 
  },
  methods: {
    onItemClick() {
      this.onEvent('onclick', {
        name: this.name,
        event: null,
        type: 'click',
        triggerType: 'onclick',
        value: this.formModel.value
      })
    }
  }
}
</script>
<style lang='less' scoped>
@import "../../../assets/styles/form.less";
.za-link{
  display: flex;
  .link-text{
    flex: 1
  }
}
</style>
