ant-design-vue/index-with-locales.js

13 lines
291 B
JavaScript
Raw Normal View History

2019-01-12 11:33:27 +08:00
const antd = require('./components');
2022-03-12 23:00:23 +08:00
2023-02-23 12:21:23 +08:00
const req = require.context('./components', true, /^\.\/locale\/.+_.+\.tsx?$/);
2018-03-18 19:59:38 +08:00
2019-01-12 11:33:27 +08:00
antd.locales = {};
2018-03-18 19:59:38 +08:00
2019-01-12 11:33:27 +08:00
req.keys().forEach(mod => {
2023-02-23 12:21:23 +08:00
const matches = mod.match(/\/([^/]+).tsx?$/);
2022-03-12 23:00:23 +08:00
antd.locales[matches[1]] = req(mod).default;
2019-01-12 11:33:27 +08:00
});
2018-03-18 19:59:38 +08:00
2019-01-12 11:33:27 +08:00
module.exports = antd;