Add missing files

This commit is contained in:
Pig Fang 2018-07-27 16:54:36 +08:00
parent e7c2ceeeb4
commit 18274d4d22
2 changed files with 18 additions and 0 deletions

View File

@ -0,0 +1,4 @@
export default {
success() {},
warning() {},
};

View File

@ -0,0 +1,14 @@
import 'jest-extended';
import Vue from 'vue';
Vue.prototype.$t = key => key;
Vue.directive('t', (el, { value }) => {
if (typeof value === 'string') {
el.innerHTML = value;
} else if (typeof value === 'object') {
el.innerHTML = value.path;
} else {
throw new Error('[i18n] Invalid arguments in `v-t` directive.');
}
});