Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

⚡ improvement(warnings): make warning messages clearer #396

Merged
merged 1 commit into from
Jul 24, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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