我是靠谱客的博主 细腻白开水,这篇文章主要介绍antd-pro-vue,现在分享给大家,希望可以做个参考。

安装

vue create vue-cli
在这里插入图片描述
npm i ant-design-vue moment

yarn add ant-design-vue
yarn add moment

在.eslintrc.js文件中配置关闭Prettier;
在rules中增加一行:“prettier/prettier”: “off”

配置 vue.config.js

复制代码
1
2
3
4
5
6
7
8
9
10
module.exports = { css: { loaderOptions: { less: { javascriptEnabled: true, }, }, }, };

配置 babel.config

复制代码
1
2
3
4
5
6
7
module.exports = { presets: ['@vue/cli-plugin-babel/preset'], plugins: [ ['import', { libraryName: 'ant-design-vue', libraryDirectory: 'es', style: true }], // `style: true` 会加载 less 文件 ], };

main.js

复制代码
1
2
3
import { Button } from 'ant-design-vue'; Vue.use(Button);

进度条就是NProgress实现的效果

复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// to是跳转后的页面路由,from是跳转前的,next是必须要执行的,加上next路由才会跳转 router.beforeEach((to, from, next) => { if (to.path !== from.path) { NProgress.start(); } next(); }); router.afterEach(() => { NProgress.done(); });

最后

以上就是细腻白开水最近收集整理的关于antd-pro-vue的全部内容,更多相关antd-pro-vue内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(60)

评论列表共有 0 条评论

立即
投稿
返回
顶部