ElementUI, load the current language pack

This commit is contained in:
pushuo 2023-03-17 10:08:03 +08:00 committed by Edward Yang
parent 423ed6a145
commit 8e49870218
3 changed files with 19 additions and 5 deletions

View File

@ -4,5 +4,5 @@
*/
#bk-stripe-app .form-wrap {
max-width: 400px;
/* max-width: 500px; */
}

View File

@ -18,13 +18,13 @@
</el-form-item>
<el-form-item label="{{ __('Stripe::common.expiration_date') }}" required>
<div class="d-flex align-items-center">
<el-form-item prop="year">
<el-date-picker class="w-auto me-2" v-model="form.year" format="yyyy" value-format="yyyy"
<el-form-item prop="year" class="flex-grow-1">
<el-date-picker class="w-100 me-2" v-model="form.year" format="yyyy" value-format="yyyy"
type="year" placeholder="{{ __('Stripe::common.year') }}">
</el-date-picker>
</el-form-item>
<el-form-item prop="month">
<el-date-picker v-model="form.month" class="w-auto" format="MM" value-format="MM" type="month"
<el-form-item prop="month" class="flex-grow-1 ms-3">
<el-date-picker v-model="form.month" class="w-100" format="MM" value-format="MM" type="month"
placeholder="{{ __('Stripe::common.month') }}">
</el-date-picker>
</el-form-item>

View File

@ -38,6 +38,20 @@
isLogin: !!{{ current_customer()->id ?? 'null' }},
guestCheckout: !!{{ system_setting('base.guest_checkout', 1) }}
}
// 如果页面使用了ElementUI且当前语言不是中文则加载对应的语言包
@if (locale() != 'zh_cn')
if (typeof ELEMENT !== 'undefined') {
const elLocale = '{{ asset('vendor/element-ui/language/'.locale().'.js') }}';
document.write("<script src='" + elLocale + "'><\/script>")
$(function () {
setTimeout(() => {
ELEMENT.locale(ELEMENT.lang['{{ locale() }}'])
}, 0);
})
}
@endif
</script>
@stack('add-scripts')