上次体验了一下vue3+element-plus,总体感觉element-plus比element(vue2)好使且多一些功能。
这次体验一下vue3+ant-design2(vue3)
- 安装好之后按需引入 ant 组件
ant.congig.js:
import "ant-design-vue/dist/antd.css";
import {
Button,
Menu,
SubMenu,
MenuItemGroup,
Row,
Col,
Radio,
RadioGroup,
RadioButton,
Tabs,
TabPane
// ....
} from "ant-design-vue";
const antComponents = [
Button,
Menu,
SubMenu,
MenuItemGroup,
Col,
Row,
Radio,
RadioGroup,
RadioButton,
Tabs,
TabPane
// ....
];
export default antComponents;
main.js:
import antComponents from "./******/ant.config";
antComponents.forEach((component) => {
app.use(component);
});
-
table 宽度超出容器,fixed 滚动失效
使用了 display:flex;布局,装有 table 的父级容器设置了 flex: 1; 这样 table 没法识别父级容器的宽度就超出父容器显示。解决: 1.不使用 flex
2.table 父容器设置宽度,不想固定宽度可通过calc(100% - XXX)
计算。 -
时间选择器国际化问题
使用ConfigProvider
组件:
<a-config-provider :locale="zhCN">
<!-- 包裹内容 -->
</a-config-provider>
import zhCN from<