支持 jsx 的 table/form-item/table-column 封装,可通过 json 全部一次性生成。 项目没有进行打包,各位随便下载使用。
- 由于 vue2 无法通过配置控制 vnode 内容,导致自由度大大降低,特此写了个这样的基于 jsx 的框架,方便配置使用。
- elementUI 的组件都是原子组件,无法批量应用到管理后台,所以在此基础上多做了一层封装。
npm install @vue/babel-preset-jsx @vue/babel-helper-vue-jsx-merge-props vue2pro_element
-
babel.config.js:
module.exports = { presets: ["@vue/babel-preset-jsx"], };
-
main.js
import "element-ui/lib/theme-chalk/index.css"; import ProElement from "vue2pro_element"; import ElementUI from "element-ui"; Vue.use(ElementUI, { size: "small" }); Vue.use(ProElement);
列表 https://github.com/frankcou/vue2pro_element/tree/master/src/test/list.vue
详情/新增/编辑 https://github.com/frankcou/vue2pro_element/tree/master/src/test/detail.vue
文档地址:https://github.com/frankcou/vue2pro_element.git
vue run serve