if (self.form.pickupTime == '') {
self.formError.pickupTime = 'Ready for pickup time is required.';
status = false;
return status;
} else {
self.formError.pickupTime = '';
}
我需要翻译“需要准备上车时间”。这是Vue
和Laravel
文件。尝试过{{ $t('vue.readytime') }}
,但弹出错误。有什么想法吗?
答案 0 :(得分:0)
您可以在某些.blade.php文件中定义lang vars
var lang = {
pickupTime: "{{ t('vue.readytime') }}",
};
并在vue组件中使用lang var
self.formError.pickupTime = lang.pickupTime;