antd-mobile-vue-next
在此前发布的Antd Mobile Vue的基础上进行了vue3.0的升级
这是目前为止Ant Design Mobile移植到Vue最完整的组件库
新增部分v5组件移植
如有问题可添加个人微信(wuhao1200),欢迎共同交流
antd-mobile-vue
基于 Vue3 的组件库,代码由antd-mobile转为Vue版本,目前已具备antd-mobile的绝大部分组件
部分组件的示例已和 ant design mobile
官网同步
与antd-mobile的组件对比
antd-mobile 共有 47
个组件,本项目截至现在移植了44
个, 组件完成度达到95%
antd-mobile V5 共有 58
个组件(不含ConfigProvider),本项目截至现在移植了51
个, 组件完成度达到88%
与ant design mobile的组件比较
组件名称 | antd-mobile | antd-mobile-vue | 示例移植 | 说明 |
---|---|---|---|---|
Accordion | √ | √ | √ | |
ActionSheet | √ | √ | √ | |
ActivityIndicator | √ | √ | √ | |
Badge | √ | √ | √ | |
Button | √ | √ | √ | |
Calendar | √ | √ | √ | |
Card | √ | √ | √ | |
Carousel | √ | √ | √ | |
Checkbox | √ | √ | √ | |
DatePicker | √ | √ | √ | |
DatePickerView | √ | √ | √ | |
Drawer | √ | √ | √ | |
Empty | √ | √ | √ | |
Flex | √ | √ | √ | |
Grid | √ | √ | ||
Icon | √ | √ | √ | |
ImagePicker | √ | √ | ||
InfiniteScroll | √ | v | √ | |
InputItem | √ | v | √ | |
List | √ | √ | √ | |
ListView | √ | [无] | ||
Loading | √ | √ | √ | |
Mask | √ | √ | √ | |
Menu | √ | √ | √ | |
Modal | √ | √ | √ | |
NavBar | √ | √ | √ | |
NoticeBar | √ | √ | √ | |
Pagination | √ | √ | √ | |
Picker | √ | √ | √ | |
PickerView | √ | √ | ||
Popover | √ | √ | √ | |
Progress | √ | √ | √ | |
Radio | √ | √ | √ | |
PullToRefresh | √ | √ | √ | |
Result | √ | √ | √ | |
SearchBar | √ | √ | ||
SegmentedControl | √ | √ | √ | |
Space | √ | √ | √ | |
Slider | √ | √ | √ | |
Range | √ | √ | √ | |
Stepper | √ | √ | √ | |
Steps | √ | √ | √ | |
SwipeAction | √ | √ | ||
Switch | √ | √ | ||
TabBar | √ | √ | √ | |
Tabs | √ | √ | √ | |
Tag | √ | √ | √ | |
TextareaItem | √ | √ | √ | |
Toast | √ | √ | √ | |
WhiteSpace | √ | √ | √ | |
WingBlank | √ | √ | √ | |
LocaleProvider | √ | [无] | ||
AutoCenter | √ | |||
CapsuleTabs | √ | |||
Cascader | √ | |||
CascaderView | √ | |||
Dropdown | √ | |||
Ellipsis | √ | |||
FloatingBubble | √ | |||
ErrorBlock | √ | |||
FloatingPanel | √ | |||
Image | √ | |||
ImageViewer | √ | |||
ImageUploader | √ | |||
IndexBar | √ | |||
JumboTabs | √ | |||
NumberKeyboard | √ | |||
PasscodeInput | √ | |||
ProgressCircle | √ | |||
SafeArea | √ | |||
Selector | √ | |||
Skeleton | √ | |||
SideBar | √ | |||
Swiper | √ | |||
TreeSelect | √ | |||
VirtualInput | √ | |||
WaterMark | √ |
安装
npm i antd-mobile-vue-next -S
使用
import AntdMobile from 'antd-mobile-vue-next'
app.use(AntdMobile)
按需引入
按需加载需要借助babel-plugin-import
, 这样就可以只引入需要的组件,以减小项目体积
npm i babel-plugin-import -D
将babel.config.js修改为:
module.exports = {
presets: ['@vue/app'],
plugins: [
[
'import',
{
libraryName: 'antd-mobile-vue-next',
libraryDirectory: 'es',
style: true
},
'antd-mobile-vue-next'
]
]
};
引入组件
import { Alert } from "antd-mobile-vue-next";
defineComponent({
components: {
[Alert.name]: Alert
}
});
开发环境启动
npm run dev
打包
npm run build
发布到npm仓库
npm publish
Dependencies
@antv/f2: ^3.7.7async-validator: ^4.0.1classnames: ^2.2.6cssbeautify: ^0.3.1debounce: ^1.2.0exenv: ^1.2.2fs: 0.0.1-securityhtml: ^1.0.0js-beautify: ^1.9.1lodash.clonedeep: ^4.5.0lodash.debounce: ^4.0.8lodash.isequal: ^4.5.0lodash.merge: ^4.6.2normalize.css: ^8.0.1omit.js: ^1.0.2raf: ^3.4.1rollup-plugin-typescript2: ^0.30.0shallowequal: ^1.1.0
Dependencies
@ant-design/icons-vue: ^6.0.1@babel/plugin-proposal-export-default-from: ^7.14.5@babel/plugin-transform-object-assign: ^7.12.13@babel/plugin-transform-runtime: ^7.13.10@babel/plugin-proposal-export-namespace-from: ^7.18.9@babel/plugin-proposal-nullish-coalescing-operator: ^7.18.6@babel/plugin-proposal-object-rest-spread: ^7.20.7@babel/plugin-proposal-optional-chaining: ^7.21.0@babel/plugin-transform-object-rest-spread: ^7.22.11@babel/plugin-transform-optional-chaining: ^7.22.12@babel/preset-env: ^7.13.12@babel/preset-typescript: ^7.13.0@octokit/rest: ^16.28.7@types/axios: ^0.14.0@types/classnames: ^2.2.7@types/codemirror: 0.0.72@types/highlight.js: ^9.12.3@types/lodash.debounce: ^4.0.6@types/vue-markdown: ^2.2.1@vitejs/plugin-vue: ^1.2.1@vitejs/plugin-vue-jsx: ^1.1.3@vue/babel-preset-jsx: ^1.2.4@vue/cli-plugin-babel: ~4.5.0@vue/cli-plugin-router: ~4.5.0@vue/cli-plugin-typescript: ^4.5.4@vue/cli-plugin-vuex: ~4.5.0@vue/cli-service: ~4.5.0@vue/compiler-sfc: ^3.2.26add-dom-event-listener: ^1.1.0ant-design-vue: ^4.0.1antd-mobile-demo-data: ^0.3.0array-tree-filter: ^2.1.0axios: ^0.21.1babel-plugin-import: ^1.13.3babel-plugin-transform-class-properties: ^6.24.1babel-plugin-transform-es3-property-literals: ^6.22.0babel-plugin-transform-object-assign: ^6.22.0babel-plugin-transform-object-rest-spread: ^6.26.0case-sensitive-paths-webpack-plugin: ^2.2.0codemirror: ^5.45.0colorful: ^2.1.0compare-versions: ^3.5.1compression-webpack-plugin: ^2.0.0csso: ^3.5.1dayjs: ^1.11.2decoded-text-loader: ^1.0.0dependency-tree: ^7.0.2dom-align: ^1.8.2esdk-obs-nodejs: ^3.1.3esdk-obs-nodejs-new: ^3.1.3fast-glob: ^3.0.4file-loader: ^3.0.1friendly-errors-webpack-plugin: ^1.7.0html-loader: ^0.5.5less: ^3.0.4less-loader: ^4.1.0less-plugin-npm-import: ^2.1.0lint-staged: ^8.1.5lodash: ^4.17.21markdown-loader: ^5.0.0mini-css-extract-plugin: ^0.8.0node-ts: ^5.1.2omit: ^1.0.1optimize-css-assets-webpack-plugin: ^5.0.3raw-loader: ^2.0.0rollup-plugin-esbuild: ^3.0.2rollup-plugin-vue: ^6.0.0rollup-plugin-vue-jsx-compat: 0.0.2shallow-equal: ^1.1.0shelljs: ^0.8.3signale: ^1.4.0style-loader: ^0.23.1throttle-debounce: ^2.1.0ts-lint: ^4.5.1typescript: ^4.2.3uglifyjs-webpack-plugin: ^2.2.0uppercamelcase: ^3.0.0vite: ^2.1.5vite-plugin-md: ^0.10.0vite-plugin-string: ^1.0.1vite-plugin-vuedoc: ^3.1.3vue: ^3.2.26vue-class-component: ^8.0.0-rc.1vue-clipboard2: ^0.3.1vue-router: ^4.0.5vue-tsc: ^0.0.15vuex: ^4.0.0warning: ^4.0.3