Skip to content
This repository has been archived by the owner on Dec 25, 2017. It is now read-only.

Commit

Permalink
refactor(errors): fix validator-error component fragment warnning
Browse files Browse the repository at this point in the history
  • Loading branch information
kazupon committed Feb 18, 2016
1 parent 75338b4 commit a7af6de
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/components/error.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export default function (Vue) {
}
},

template: '<template><partial :name="partial"></partial></template>',
template: '<div><partial :name="partial"></partial></div>',

partials: {}
}
Expand Down
10 changes: 3 additions & 7 deletions test/specs/components/errors.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,22 +62,18 @@ describe('validator-errors', () => {
'<input type="text" v-validate:field2="field2">' +
'<validator-errors :partial="\'custom-error\'":validation="$validation"></validator-errors>' +
'</validator>'
Vue.partial('custom-error', '<span>{{field}}:{{validator}}:{{message}}</span>')
vm = new Vue({
partials: {
'custom-error': '<span>{{field}}:{{validator}}:{{message}}</span>'
},
el: el,
data: {
field1: { pattern: { rule: '/foo/', message: 'field1 pattern error' } },
field2: {
required: { rule: true, message: 'field2 required' },
minlength: { rule: 2, message: 'field2 short too' }
}
}
}).$mount()
vm.$nextTick(() => {
vm.$appendTo(el)
done()
})
vm.$nextTick(done)
})

it('should be rendered error messages', () => {
Expand Down

0 comments on commit a7af6de

Please sign in to comment.