feat: compatible with Vue 2.x

This commit is contained in:
Amour1688
2020-05-27 12:52:52 +08:00
parent 7e0ee7dc5e
commit dcadabd28a
5 changed files with 37 additions and 1 deletions

View File

@ -0,0 +1,3 @@
# @ant-design-vue/babel-helper-vue-compatible-props
> compatible with Vue 2.x

View File

@ -0,0 +1,12 @@
const transformOn = require('@ant-design-vue/babel-helper-vue-transform-on');
const compatibleProps = (attr) => {
const {
props, on = {}, attrs, ...rest
} = attr || {};
return {
...props, ...attrs, ...transformOn(on), ...rest,
};
};
module.exports = compatibleProps;

View File

@ -0,0 +1,16 @@
{
"name": "@ant-design-vue/babel-helper-vue-compatible-props",
"version": "1.0.0",
"description": "compatible with Vue 2.x",
"author": "Amour1688 <lcz_1996@foxmail.com>",
"homepage": "https://github.com/vueComponent/jsx#readme",
"license": "MIT",
"main": "index.js",
"repository": {
"type": "git",
"url": "git+https://github.com/vueComponent/jsx.git"
},
"dependencies": {
"@ant-design-vue/babel-helper-vue-transform-on": "^1.0.1"
}
}