Skip to content

Commit

Permalink
⚡ improvement(warnings): make warning messages clearer (#396) by @kim…
Browse files Browse the repository at this point in the history
  • Loading branch information
kimuraz authored and kazupon committed Jul 24, 2018
1 parent ad4d961 commit 79eee1b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions dist/vue-i18n.js
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@
function unbind (el, binding, vnode, oldVNode) {
var vm = vnode.context;
if (!vm) {
warn('not exist Vue instance in VNode context');
warn('Vue instance does not exists in VNode context');
return
}

Expand All @@ -431,12 +431,12 @@
function assert (el, vnode) {
var vm = vnode.context;
if (!vm) {
warn('not exist Vue instance in VNode context');
warn('Vue instance does not exists in VNode context');
return false
}

if (!vm.$i18n) {
warn('not exist VueI18n instance in Vue instance');
warn('VueI18n instance does not exists in Vue instance');
return false
}

Expand Down
10 changes: 5 additions & 5 deletions src/directive.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export function update (el: any, binding: Object, vnode: any, oldVNode: any): vo
export function unbind (el: any, binding: Object, vnode: any, oldVNode: any): void {
const vm: any = vnode.context
if (!vm) {
warn('not exist Vue instance in VNode context')
warn('Vue instance does not exists in VNode context')
return
}

Expand All @@ -33,12 +33,12 @@ export function unbind (el: any, binding: Object, vnode: any, oldVNode: any): vo
function assert (el: any, vnode: any): boolean {
const vm: any = vnode.context
if (!vm) {
warn('not exist Vue instance in VNode context')
warn('Vue instance doest not exists in VNode context')
return false
}

if (!vm.$i18n) {
warn('not exist VueI18n instance in Vue instance')
warn('VueI18n instance does not exists in Vue instance')
return false
}

Expand All @@ -55,12 +55,12 @@ function t (el: any, binding: Object, vnode: any): void {

const { path, locale, args, choice } = parseValue(value)
if (!path && !locale && !args) {
warn('not support value type')
warn('value type not supported')
return
}

if (!path) {
warn('required `path` in v-t directive')
warn('`path` is required in v-t directive')
return
}

Expand Down

0 comments on commit 79eee1b

Please sign in to comment.