@antdv/pro-field
Version:
原子信息组件,统一 ProForm、ProTable、ProList、Filter 等组件里面的字段定义。
48 lines (47 loc) • 1.46 kB
JavaScript
import { mergeProps as _mergeProps, createVNode as _createVNode } from "vue";
import { useStyle } from "@antdv/pro-provider";
import { classNames, omit, stringType } from "@antdv/pro-utils";
import { useConfigContextInject } from "ant-design-vue/lib/config-provider/context";
import { defineComponent } from "vue";
import { buildProFieldProp } from "../props.mjs";
const fieldTextAreaReadonlyProps = buildProFieldProp({
text: stringType()
});
var stdin_default = defineComponent({
name: "FieldTextAreaReadonly",
inheritAttrs: false,
props: fieldTextAreaReadonlyProps,
setup(props) {
const {
getPrefixCls
} = useConfigContextInject();
const readonlyClassName = getPrefixCls("pro-field-readonly");
const compClassName = `${readonlyClassName}-textarea`;
const {
wrapSSR,
hashId
} = useStyle("TextArea", () => {
return {
[`.${compClassName}`]: {
display: "inline-block",
lineHeight: "1.5715",
maxWidth: "100%",
whiteSpace: "pre-wrap"
}
};
});
return () => {
const {
text,
fieldProps
} = props;
return wrapSSR(_createVNode("span", _mergeProps({
"class": classNames(hashId.value, readonlyClassName, compClassName)
}, omit(fieldProps, ["autoSize", "classNames", "styles"])), [text != null ? text : "-"]));
};
}
});
export {
stdin_default as default,
fieldTextAreaReadonlyProps
};