maestro-server/bootue

View on GitHub
src/forms/radio/template.html

Summary

Maintainability
Test Coverage
<div :is="buttonStyle?'label':'div'" @click.prevent="toggle"
  :class="[(buttonStyle?'btn btn-'+typeColor:'radio '+typeColor),{active:active,disabled:disabled,readonly:readonly}]"
>
  <template v-if="buttonStyle">
    <input type="radio" autocomplete="off" ref="input"
      v-show="!readonly"
      v-model="check"
      :value="selectedValue"
      :name="name"
      :readonly="readonly"
      :disabled="disabled"
    />
    <slot></slot>
  </template>
  <label v-else class="open">
    <input type="radio" autocomplete="off" ref="input"
      v-model="check"
      :value="selectedValue"
      :name="name"
      :readonly="readonly"
      :disabled="disabled"
    />
    <span class="icon dropdown-toggle" :class="[active?'btn-'+typeColor:'',{bg:typeColor==='default'}]"></span>
    <span v-if="active&&typeColor==='default'" class="icon"></span>
    <slot></slot>
  </label>
</div>