mirror of
https://gitee.com/ant-design-vue/ant-design-vue.git
synced 2024-12-02 03:58:05 +08:00
cr pagination & popover & popconfirm & tree-select
This commit is contained in:
parent
f94f50f326
commit
a47a820a29
@ -4,6 +4,7 @@ import MiniSelect from './MiniSelect';
|
||||
import LocaleReceiver from '../locale-provider/LocaleReceiver';
|
||||
import { getOptionProps } from '../_util/props-util';
|
||||
import VcPagination from '../vc-pagination';
|
||||
import enUS from '../pagination/locale/en_US';
|
||||
import Icon from '../icon';
|
||||
import { ConfigConsumerProps } from '../config-provider';
|
||||
|
||||
@ -44,7 +45,7 @@ export default {
|
||||
...PaginationProps(),
|
||||
},
|
||||
inject: {
|
||||
configProvider: { default: () => ({}) },
|
||||
configProvider: { default: () => ConfigConsumerProps },
|
||||
},
|
||||
methods: {
|
||||
getIconsProps(prefixCls) {
|
||||
@ -118,7 +119,7 @@ export default {
|
||||
},
|
||||
render() {
|
||||
return (
|
||||
<LocaleReceiver componentName="Pagination" scopedSlots={{ default: this.renderPagination }} />
|
||||
<LocaleReceiver componentName="Pagination" defaultLocale={enUS} scopedSlots={{ default: this.renderPagination }} />
|
||||
);
|
||||
},
|
||||
};
|
||||
|
@ -41,7 +41,7 @@ const Popconfirm = {
|
||||
},
|
||||
},
|
||||
inject: {
|
||||
configProvider: { default: () => ({}) },
|
||||
configProvider: { default: () => ConfigConsumerProps },
|
||||
},
|
||||
data() {
|
||||
const props = getOptionProps(this);
|
||||
|
@ -10,7 +10,7 @@ const Popover = {
|
||||
name: 'APopover',
|
||||
props: {
|
||||
...props,
|
||||
prefixCls: PropTypes.string.def('ant-popover'),
|
||||
prefixCls: PropTypes.string,
|
||||
transitionName: PropTypes.string.def('zoom-big'),
|
||||
content: PropTypes.any,
|
||||
title: PropTypes.any,
|
||||
@ -20,7 +20,7 @@ const Popover = {
|
||||
event: 'visibleChange',
|
||||
},
|
||||
inject: {
|
||||
configProvider: { default: () => ({}) },
|
||||
configProvider: { default: () => ConfigConsumerProps },
|
||||
},
|
||||
methods: {
|
||||
getPopupDomNode() {
|
||||
|
@ -26,8 +26,8 @@
|
||||
| suffixIcon | The custom suffix icon | VNode \| slot | - |
|
||||
| treeCheckable | Whether to show checkbox on the treeNodes | boolean | false |
|
||||
| treeCheckStrictly | Whether to check nodes precisely (in the `checkable` mode), means parent and child nodes are not associated, and it will make `labelInValue` be true | boolean | false |
|
||||
| treeData | Data of the treeNodes, manual construction work is no longer needed if this property has been set(ensure the Uniqueness of each value) | array<{ value, label, children, [disabled, disableCheckbox, selectable] }> | \[] |
|
||||
| treeDataSimpleMode | Enable simple mode of treeData.(treeData should like this: [{id:1, pId:0, value:'1', label:"test1",...},...], pId is parent node's id) | false\|Array<{ id: string, pId: string, rootPId: null }> | false |
|
||||
| treeData | Data of the treeNodes, manual construction work is no longer needed if this property has been set(ensure the Uniqueness of each value) | array\<{ value, title, children, \[disabled, disableCheckbox, selectable] }> | \[] |
|
||||
| treeDataSimpleMode | Enable simple mode of treeData. Changes the `treeData` schema to: \[{id:1, pId:0, value:'1', title:"test1",...},...] where pId is parent node's id). It is possible to replace the default `id` and `pId` keys by providing object to `treeDataSimpleMode` | false\|object\<{ id: string, pId: string, rootPId: null }> | false |
|
||||
| treeDefaultExpandAll | Whether to expand all treeNodes by default | boolean | false |
|
||||
| treeDefaultExpandedKeys | Default expanded treeNodes | string\[] \| number\[] | - |
|
||||
| treeExpandedKeys(.sync) | Set expanded keys | string\[] \| number\[] | - |
|
||||
|
@ -33,7 +33,7 @@ const TreeSelect = {
|
||||
event: 'change',
|
||||
},
|
||||
inject: {
|
||||
configProvider: { default: () => ({}) },
|
||||
configProvider: { default: () => ConfigConsumerProps },
|
||||
},
|
||||
created() {
|
||||
warning(
|
||||
@ -99,9 +99,7 @@ const TreeSelect = {
|
||||
const getPrefixCls = this.configProvider.getPrefixCls || ConfigConsumerProps.getPrefixCls;
|
||||
const prefixCls = getPrefixCls('select', customizePrefixCls);
|
||||
|
||||
const renderEmpty =
|
||||
(this.configProvider.renderEmpty && this.configProvider.renderEmpty()) ||
|
||||
ConfigConsumerProps.renderEmpty;
|
||||
const renderEmpty = this.configProvider.renderEmpty;
|
||||
const notFoundContent = getComponentFromProp(this, 'notFoundContent');
|
||||
const { getPopupContainer: getContextPopupContainer } = this.configProvider;
|
||||
const rest = omit(restProps, [
|
||||
|
@ -27,7 +27,7 @@
|
||||
| treeCheckable | 显示 checkbox | boolean | false |
|
||||
| treeCheckStrictly | checkable 状态下节点选择完全受控(父子节点选中状态不再关联),会使得 `labelInValue` 强制为 true | boolean | false |
|
||||
| treeData | treeNodes 数据,如果设置则不需要手动构造 TreeNode 节点(value 在整个树范围内唯一) | array<{value, label, children, [disabled, disableCheckbox, selectable]}> | \[] |
|
||||
| treeDataSimpleMode | 使用简单格式的 treeData,具体设置参考可设置的类型 (此时 treeData 应变为这样的数据结构: [{id:1, pId:0, value:'1', label:"test1",...},...], `pId` 是父节点的 id) | false\|Array<{ id: string, pId: string, rootPId: null }> | false |
|
||||
| treeDataSimpleMode | 使用简单格式的 treeData,具体设置参考可设置的类型 (此时 treeData 应变为这样的数据结构: \[{id:1, pId:0, value:'1', label:"test1",...},...], `pId` 是父节点的 id) | false\|Array<{ id: string, pId: string, rootPId: null }> | false |
|
||||
| treeDefaultExpandAll | 默认展开所有树节点 | boolean | false |
|
||||
| treeDefaultExpandedKeys | 默认展开的树节点 | string\[] \| number\[] | - |
|
||||
| treeExpandedKeys(.sync) | 设置展开的树节点 | string\[] \| number\[] | - |
|
||||
|
4
types/tree-select.d.ts
vendored
4
types/tree-select.d.ts
vendored
@ -18,6 +18,10 @@ export interface TreeData {
|
||||
export declare class TreeSelect extends AntdComponent {
|
||||
static TreeNode: typeof TreeNode;
|
||||
|
||||
treeIcon?: boolean;
|
||||
|
||||
notFoundContent?: any;
|
||||
|
||||
/**
|
||||
* Whether allow clear
|
||||
* @default false
|
||||
|
Loading…
Reference in New Issue
Block a user