Skip to content

Commit

Permalink
feat: add role for Fieldset, use more generic wrapper for Field
Browse files Browse the repository at this point in the history
  • Loading branch information
Justineo committed Jun 14, 2018
1 parent 329956b commit 32789a0
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
10 changes: 5 additions & 5 deletions packages/veui/src/components/Form/Field.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@
'veui-field-required': isRequired
}"
>
<span v-if="label || $slots.label" class="veui-form-label">
<div v-if="label || $slots.label" class="veui-form-label">
<slot name="label"><veui-label>{{ label }}</veui-label></slot>
</span>
</div>
<slot/>
<span v-if="tip || $slots.tip" class="veui-form-tip"><slot name="tip">{{ tip }}</slot></span>
<p
<div v-if="tip || $slots.tip" class="veui-form-tip"><slot name="tip">{{ tip }}</slot></div>
<div
v-if="!validity.valid && !!validity.message"
class="veui-field-error"
:title="validity.message"
><veui-icon :name="icons.alert"/>{{ validity.message }}</p>
><veui-icon :name="icons.alert"/>{{ validity.message }}</div>
</div>
</template>

Expand Down
10 changes: 9 additions & 1 deletion packages/veui/src/components/Form/Fieldset.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
<template>
<veui-field :ui="ui" ref="field" class="veui-fieldset" :class="{'veui-fieldset-required': required}" v-bind="attrs">
<veui-field
:ui="ui"
ref="field"
class="veui-fieldset"
:class="{
'veui-fieldset-required': required
}"
role="group"
v-bind="attrs">
<template v-if="$slots.label" slot="label"><slot name="label"/></template>
<slot/>
<template v-if="$slots.tip" slot="tip"><slot name="tip"/></template>
Expand Down

0 comments on commit 32789a0

Please sign in to comment.