hot-form
Version:
A project developed based on ant-design-vue and vant whitch do some things on create/render/modify and etc. for forms. Also can custom some component on the form items if you want. 一个基于antdv/vant开发的创建表单组件,包含表单渲染、表单编辑页面、以及植入自定义附加内容的组件
33 lines (31 loc) • 977 B
JavaScript
// 包裹富文本组件,默认提供 http 方法
export const wrappedEditor = function (component) {
const baseURL = process.env.BASE_URL + 'tinymce';
const getAutoSavePrefix = path => `form-tinyMCE-autosave-${path}-`;
return {
functional: true,
props: {
config: Object,
baseURL: {
type: String,
default: baseURL,
},
documentURL: {
type: String,
// default: config.assetsURL,
},
},
render(h, context) {
// const { $route, $store } = context.parent;
const props = {
...context.props,
// 设置富文本所需的静态资源的基础 url
// autoSavePrefix: getAutoSavePrefix($route.fullPath),
autoSavePrefix: getAutoSavePrefix(''),
// skin: $store.state.app.layout.menuTheme ?? 'light',
skin: 'light',
};
return h(component, { ...context.data, props }, context.children);
},
};
};