commit
ba307d7961
15 changed files with 904 additions and 857 deletions
|
@ -3,6 +3,7 @@
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<title>iView test page</title>
|
<title>iView test page</title>
|
||||||
|
<meta name="viewport" content="user-scalable=no,width=device-width,initial-scale=1"/>
|
||||||
<!-- <link href="/test/dist/main.css" rel="stylesheet"> -->
|
<!-- <link href="/test/dist/main.css" rel="stylesheet"> -->
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
|
@ -62,6 +62,13 @@
|
||||||
<br><br>
|
<br><br>
|
||||||
<Tag v-for="item in count" :key="item" :name="item" closable @on-close="handleClose2">标签{{ item + 1 }}</Tag>
|
<Tag v-for="item in count" :key="item" :name="item" closable @on-close="handleClose2">标签{{ item + 1 }}</Tag>
|
||||||
<Button icon="ios-plus-empty" type="dashed" size="small" @click="handleAdd">添加标签</Button>
|
<Button icon="ios-plus-empty" type="dashed" size="small" @click="handleAdd">添加标签</Button>
|
||||||
|
|
||||||
|
<br><br><hr><br>
|
||||||
|
<Tag :checked="checked" checkable>test</Tag>
|
||||||
|
<Button @click="toggle">
|
||||||
|
Toggle
|
||||||
|
</Button>
|
||||||
|
<span>{{ checked }}</span>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
|
@ -69,7 +76,8 @@
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
show: true,
|
show: true,
|
||||||
count: [0, 1, 2]
|
count: [0, 1, 2],
|
||||||
|
checked: true
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
@ -86,6 +94,9 @@
|
||||||
handleClose2 (event, name) {
|
handleClose2 (event, name) {
|
||||||
const index = this.count.indexOf(name);
|
const index = this.count.indexOf(name);
|
||||||
this.count.splice(index, 1);
|
this.count.splice(index, 1);
|
||||||
|
},
|
||||||
|
toggle() {
|
||||||
|
this.checked = !this.checked;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -294,8 +294,11 @@
|
||||||
this.$refs.input.currentValue = '';
|
this.$refs.input.currentValue = '';
|
||||||
const oldVal = JSON.stringify(this.currentValue);
|
const oldVal = JSON.stringify(this.currentValue);
|
||||||
this.currentValue = item.value.split(',');
|
this.currentValue = item.value.split(',');
|
||||||
|
// use setTimeout for #4786, can not use nextTick, because @on-find-selected use nextTick
|
||||||
|
setTimeout(() => {
|
||||||
this.emitValue(this.currentValue, oldVal);
|
this.emitValue(this.currentValue, oldVal);
|
||||||
this.handleClose();
|
this.handleClose();
|
||||||
|
}, 0);
|
||||||
},
|
},
|
||||||
handleFocus () {
|
handleFocus () {
|
||||||
this.$refs.input.focus();
|
this.$refs.input.focus();
|
||||||
|
|
|
@ -77,10 +77,16 @@
|
||||||
|
|
||||||
// return value back recursion // 向上递归,设置临时选中值(并非真实选中)
|
// return value back recursion // 向上递归,设置临时选中值(并非真实选中)
|
||||||
const backItem = this.getBaseItem(item);
|
const backItem = this.getBaseItem(item);
|
||||||
if (backItem.label !== this.tmpItem.label || backItem.value !== this.tmpItem.value) {
|
// #5021 for this.changeOnSelect,加 if 是因为 #4472
|
||||||
|
if (
|
||||||
|
this.changeOnSelect ||
|
||||||
|
(backItem.label !== this.tmpItem.label || backItem.value !== this.tmpItem.value) ||
|
||||||
|
(backItem.label === this.tmpItem.label && backItem.value === this.tmpItem.value)
|
||||||
|
) {
|
||||||
this.tmpItem = backItem;
|
this.tmpItem = backItem;
|
||||||
this.emitUpdate([backItem]);
|
this.emitUpdate([backItem]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (item.children && item.children.length){
|
if (item.children && item.children.length){
|
||||||
this.sublist = item.children;
|
this.sublist = item.children;
|
||||||
this.dispatch('Cascader', 'on-result-change', {
|
this.dispatch('Cascader', 'on-result-change', {
|
||||||
|
|
|
@ -55,6 +55,7 @@
|
||||||
if (this.timeDisabled) return;
|
if (this.timeDisabled) return;
|
||||||
this.$emit('on-pick-toggle-time');
|
this.$emit('on-pick-toggle-time');
|
||||||
this.dispatch('CalendarPicker', 'focus-input');
|
this.dispatch('CalendarPicker', 'focus-input');
|
||||||
|
this.dispatch('CalendarPicker', 'update-popper');
|
||||||
},
|
},
|
||||||
handleTab(e) {
|
handleTab(e) {
|
||||||
const tabbables = [...this.$el.children];
|
const tabbables = [...this.$el.children];
|
||||||
|
|
|
@ -679,6 +679,9 @@
|
||||||
},
|
},
|
||||||
focus() {
|
focus() {
|
||||||
this.$refs.input && this.$refs.input.focus();
|
this.$refs.input && this.$refs.input.focus();
|
||||||
|
},
|
||||||
|
updatePopper () {
|
||||||
|
this.$refs.drop.update();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
|
@ -715,6 +718,7 @@
|
||||||
|
|
||||||
// to handle focus from confirm buttons
|
// to handle focus from confirm buttons
|
||||||
this.$on('focus-input', () => this.focus());
|
this.$on('focus-input', () => this.focus());
|
||||||
|
this.$on('update-popper', () => this.updatePopper());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -11,10 +11,14 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import Spin from '../spin/spin.vue';
|
||||||
|
import Icon from '../icon/icon.vue';
|
||||||
|
|
||||||
const prefixCls = 'ivu-scroll';
|
const prefixCls = 'ivu-scroll';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
props: ['text', 'active', 'spinnerHeight'],
|
props: ['text', 'active', 'spinnerHeight'],
|
||||||
|
components: { Spin, Icon },
|
||||||
computed: {
|
computed: {
|
||||||
wrapperClasses() {
|
wrapperClasses() {
|
||||||
return [
|
return [
|
||||||
|
|
|
@ -2,9 +2,7 @@
|
||||||
<li
|
<li
|
||||||
:class="classes"
|
:class="classes"
|
||||||
@click.stop="select"
|
@click.stop="select"
|
||||||
@touchend.stop="select"
|
|
||||||
@mousedown.prevent
|
@mousedown.prevent
|
||||||
@touchstart.prevent
|
|
||||||
><slot>{{ showLabel }}</slot></li>
|
><slot>{{ showLabel }}</slot></li>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
|
|
|
@ -137,6 +137,11 @@
|
||||||
this.$emit('on-change', checked, this.name);
|
this.$emit('on-change', checked, this.name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
checked (val) {
|
||||||
|
this.isChecked = val;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
|
@ -128,6 +128,10 @@
|
||||||
width: auto !important;
|
width: auto !important;
|
||||||
margin: 10px;
|
margin: 10px;
|
||||||
}
|
}
|
||||||
|
.@{modal-prefix-cls}-fullscreen{
|
||||||
|
width: 100% !important;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
.vertical-center-modal {
|
.vertical-center-modal {
|
||||||
.@{modal-prefix-cls} {
|
.@{modal-prefix-cls} {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
|
|
8
types/message.d.ts
vendored
8
types/message.d.ts
vendored
|
@ -48,8 +48,9 @@ export declare interface MessageConfig {
|
||||||
content?: string;
|
content?: string;
|
||||||
/**
|
/**
|
||||||
* 自定义描述内容,使用 Vue 的 Render 函数
|
* 自定义描述内容,使用 Vue 的 Render 函数
|
||||||
|
* @param h Render函数
|
||||||
*/
|
*/
|
||||||
render?: (h: CreateElement) => VNode;
|
render?: (h?: CreateElement) => VNode;
|
||||||
/**
|
/**
|
||||||
* 关闭时的回调
|
* 关闭时的回调
|
||||||
*/
|
*/
|
||||||
|
@ -71,7 +72,7 @@ export declare interface MessageConfig {
|
||||||
duration?: number;
|
duration?: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
declare module 'vue/types/vue' {
|
declare module "vue/types/vue" {
|
||||||
interface Vue {
|
interface Vue {
|
||||||
/**
|
/**
|
||||||
* 全局提示
|
* 全局提示
|
||||||
|
@ -79,6 +80,3 @@ declare module 'vue/types/vue' {
|
||||||
$Message: Message;
|
$Message: Message;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
29
types/modal.d.ts
vendored
29
types/modal.d.ts
vendored
|
@ -2,7 +2,7 @@
|
||||||
// Project: https://github.com/iview/iview
|
// Project: https://github.com/iview/iview
|
||||||
// Definitions by: yangdan
|
// Definitions by: yangdan
|
||||||
// Definitions: https://github.com/yangdan8/iview.git
|
// Definitions: https://github.com/yangdan8/iview.git
|
||||||
import Vue, { VNode } from 'vue';
|
import Vue, { VNode, CreateElement } from "vue";
|
||||||
|
|
||||||
export declare interface Modal {
|
export declare interface Modal {
|
||||||
/**
|
/**
|
||||||
|
@ -23,7 +23,7 @@ export declare interface Modal {
|
||||||
* 是否允许点击遮罩层关闭
|
* 是否允许点击遮罩层关闭
|
||||||
* @default true
|
* @default true
|
||||||
*/
|
*/
|
||||||
'mask-closable'?: boolean;
|
"mask-closable"?: boolean;
|
||||||
/**
|
/**
|
||||||
* 点击确定按钮时,确定按钮是否显示 loading 状态,开启则需手动设置visible来关闭对话框,
|
* 点击确定按钮时,确定按钮是否显示 loading 状态,开启则需手动设置visible来关闭对话框,
|
||||||
* @default false
|
* @default false
|
||||||
|
@ -53,12 +53,12 @@ export declare interface Modal {
|
||||||
* 确定按钮文字
|
* 确定按钮文字
|
||||||
* @default 确定
|
* @default 确定
|
||||||
*/
|
*/
|
||||||
'ok-text'?: string;
|
"ok-text"?: string;
|
||||||
/**
|
/**
|
||||||
* 取消按钮文字
|
* 取消按钮文字
|
||||||
* @default 取消
|
* @default 取消
|
||||||
*/
|
*/
|
||||||
'cancel-text'?: string;
|
"cancel-text"?: string;
|
||||||
/**
|
/**
|
||||||
* 对话框宽度,单位 px。
|
* 对话框宽度,单位 px。
|
||||||
* 对话框的宽度是响应式的,当屏幕尺寸小于 768px 时,宽度会变为自动auto,
|
* 对话框的宽度是响应式的,当屏幕尺寸小于 768px 时,宽度会变为自动auto,
|
||||||
|
@ -69,7 +69,7 @@ export declare interface Modal {
|
||||||
* 不显示底部
|
* 不显示底部
|
||||||
* @default false
|
* @default false
|
||||||
*/
|
*/
|
||||||
'footer-hide'?: boolean;
|
"footer-hide"?: boolean;
|
||||||
/**
|
/**
|
||||||
* 设置浮层样式,调整浮层位置等,该属性设置的是.ivu-modal的样式
|
* 设置浮层样式,调整浮层位置等,该属性设置的是.ivu-modal的样式
|
||||||
*/
|
*/
|
||||||
|
@ -77,17 +77,17 @@ export declare interface Modal {
|
||||||
/**
|
/**
|
||||||
* 设置对话框容器.ivu-modal-wrap的类名,可辅助实现垂直居中等自定义效果
|
* 设置对话框容器.ivu-modal-wrap的类名,可辅助实现垂直居中等自定义效果
|
||||||
*/
|
*/
|
||||||
'class-name'?: string;
|
"class-name"?: string;
|
||||||
/**
|
/**
|
||||||
* 层级
|
* 层级
|
||||||
* @default 1000
|
* @default 1000
|
||||||
*/
|
*/
|
||||||
'z-index'?: number;
|
"z-index"?: number;
|
||||||
/**
|
/**
|
||||||
* 自定义显示动画,第一项是模态框,第二项是背景,
|
* 自定义显示动画,第一项是模态框,第二项是背景,
|
||||||
* @default ['ease', 'fade']
|
* @default ['ease', 'fade']
|
||||||
*/
|
*/
|
||||||
'transition-names'?: Array<string>;
|
"transition-names"?: Array<string>;
|
||||||
/**
|
/**
|
||||||
* 是否将弹层放置于 body 内,默认值true
|
* 是否将弹层放置于 body 内,默认值true
|
||||||
* @default true
|
* @default true
|
||||||
|
@ -96,15 +96,15 @@ export declare interface Modal {
|
||||||
/**
|
/**
|
||||||
* 点击确定的回调
|
* 点击确定的回调
|
||||||
*/
|
*/
|
||||||
$emit(eventName: 'on-ok'): this;
|
$emit(eventName: "on-ok"): this;
|
||||||
/**
|
/**
|
||||||
* 开关变化时触发,返回当前的状态
|
* 开关变化时触发,返回当前的状态
|
||||||
*/
|
*/
|
||||||
$emit(eventName: 'on-cancel'): this;
|
$emit(eventName: "on-cancel"): this;
|
||||||
/**
|
/**
|
||||||
* 开关变化时触发,返回当前的状态
|
* 开关变化时触发,返回当前的状态
|
||||||
*/
|
*/
|
||||||
$emit(eventName: 'on-visible-change', visible: boolean): this;
|
$emit(eventName: "on-visible-change", visible: boolean): this;
|
||||||
/**
|
/**
|
||||||
* slot插槽对象
|
* slot插槽对象
|
||||||
*/
|
*/
|
||||||
|
@ -112,7 +112,7 @@ export declare interface Modal {
|
||||||
/**
|
/**
|
||||||
* 对话框主体内容
|
* 对话框主体内容
|
||||||
*/
|
*/
|
||||||
'': VNode[];
|
"": VNode[];
|
||||||
/**
|
/**
|
||||||
* 自定义页头
|
* 自定义页头
|
||||||
*/
|
*/
|
||||||
|
@ -171,8 +171,9 @@ export declare interface ModalConfig {
|
||||||
content?: string;
|
content?: string;
|
||||||
/**
|
/**
|
||||||
* 自定义内容,使用后不再限制类型, content 也无效。
|
* 自定义内容,使用后不再限制类型, content 也无效。
|
||||||
|
* @param h Render函数
|
||||||
*/
|
*/
|
||||||
render?: (h?) => void;
|
render?: (h?: CreateElement) => void;
|
||||||
/**
|
/**
|
||||||
* 宽度,单位 px
|
* 宽度,单位 px
|
||||||
* @default 416
|
* @default 416
|
||||||
|
@ -213,7 +214,7 @@ export declare interface ModalConfig {
|
||||||
onCancel?: () => void;
|
onCancel?: () => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
declare module 'vue/types/vue' {
|
declare module "vue/types/vue" {
|
||||||
interface Vue {
|
interface Vue {
|
||||||
/**
|
/**
|
||||||
* 对话框
|
* 对话框
|
||||||
|
|
5
types/notice.d.ts
vendored
5
types/notice.d.ts
vendored
|
@ -55,8 +55,9 @@ export declare interface NoticeConfig {
|
||||||
desc?: string;
|
desc?: string;
|
||||||
/**
|
/**
|
||||||
* 自定义描述内容,使用 Vue 的 Render 函数
|
* 自定义描述内容,使用 Vue 的 Render 函数
|
||||||
|
* @param h Render函数
|
||||||
*/
|
*/
|
||||||
render?: (h: CreateElement) => VNode;
|
render?: (h?: CreateElement) => VNode;
|
||||||
/**
|
/**
|
||||||
* 自动关闭的延时,单位秒,不关闭可以写 0 默认4.5
|
* 自动关闭的延时,单位秒,不关闭可以写 0 默认4.5
|
||||||
*/
|
*/
|
||||||
|
@ -82,7 +83,7 @@ export declare interface NoticeGlobalConfig {
|
||||||
duration?: number;
|
duration?: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
declare module 'vue/types/vue' {
|
declare module "vue/types/vue" {
|
||||||
interface Vue {
|
interface Vue {
|
||||||
/**
|
/**
|
||||||
* 通知提醒
|
* 通知提醒
|
||||||
|
|
95
types/table.d.ts
vendored
95
types/table.d.ts
vendored
|
@ -2,7 +2,7 @@
|
||||||
// Project: https://github.com/iview/iview
|
// Project: https://github.com/iview/iview
|
||||||
// Definitions by: yangdan
|
// Definitions by: yangdan
|
||||||
// Definitions: https://github.com/yangdan8/iview.git
|
// Definitions: https://github.com/yangdan8/iview.git
|
||||||
import Vue, { VNode } from 'vue';
|
import Vue, { VNode, CreateElement } from "vue";
|
||||||
|
|
||||||
export declare interface Table extends Vue {
|
export declare interface Table extends Vue {
|
||||||
/**
|
/**
|
||||||
|
@ -30,7 +30,7 @@ export declare interface Table extends Vue {
|
||||||
* 是否显示表头
|
* 是否显示表头
|
||||||
* @default true
|
* @default true
|
||||||
*/
|
*/
|
||||||
'show-header'?: boolean;
|
"show-header"?: boolean;
|
||||||
/**
|
/**
|
||||||
* 表格宽度,单位 px
|
* 表格宽度,单位 px
|
||||||
* @default 自动
|
* @default 自动
|
||||||
|
@ -49,18 +49,18 @@ export declare interface Table extends Vue {
|
||||||
* 禁用鼠标悬停时的高亮
|
* 禁用鼠标悬停时的高亮
|
||||||
* @default false
|
* @default false
|
||||||
*/
|
*/
|
||||||
'disabled-hover'?: boolean;
|
"disabled-hover"?: boolean;
|
||||||
/**
|
/**
|
||||||
* 是否支持高亮选中的行,即单选
|
* 是否支持高亮选中的行,即单选
|
||||||
* @default false
|
* @default false
|
||||||
*/
|
*/
|
||||||
'highlight-row'?: boolean;
|
"highlight-row"?: boolean;
|
||||||
/**
|
/**
|
||||||
* 行的 className 的回调方法,传入参数:
|
* 行的 className 的回调方法,传入参数:
|
||||||
* row:当前行数据
|
* row:当前行数据
|
||||||
* index:当前行的索引
|
* index:当前行的索引
|
||||||
*/
|
*/
|
||||||
'row-class-name'?: (row?: object, index?: number) => void;
|
"row-class-name"?: (row?: object, index?: number) => void;
|
||||||
/**
|
/**
|
||||||
* 表格尺寸,可选值为 large、small、default 或者不填
|
* 表格尺寸,可选值为 large、small、default 或者不填
|
||||||
*/
|
*/
|
||||||
|
@ -69,69 +69,86 @@ export declare interface Table extends Vue {
|
||||||
* 数据为空时显示的提示内容
|
* 数据为空时显示的提示内容
|
||||||
* @default 暂无数据
|
* @default 暂无数据
|
||||||
*/
|
*/
|
||||||
'no-data-text'?: string;
|
"no-data-text"?: string;
|
||||||
/**
|
/**
|
||||||
* 筛选数据为空时显示的提示内容
|
* 筛选数据为空时显示的提示内容
|
||||||
* @default 暂无筛选结果
|
* @default 暂无筛选结果
|
||||||
*/
|
*/
|
||||||
'no-filtered-data-text'?: string;
|
"no-filtered-data-text"?: string;
|
||||||
/**
|
/**
|
||||||
* 开启 highlight-row 后有效,当表格的当前行发生变化的时候会触发
|
* 开启 highlight-row 后有效,当表格的当前行发生变化的时候会触发
|
||||||
* currentRow:当前高亮行的数据
|
* currentRow:当前高亮行的数据
|
||||||
* oldCurrentRow:上一次高亮的数据
|
* oldCurrentRow:上一次高亮的数据
|
||||||
*/
|
*/
|
||||||
$emit(eventName: 'on-current-change', currentRow: object, oldCurrentRow: object): this;
|
$emit(
|
||||||
|
eventName: "on-current-change",
|
||||||
|
currentRow: object,
|
||||||
|
oldCurrentRow: object
|
||||||
|
): this;
|
||||||
/**
|
/**
|
||||||
* 在多选模式下有效,选中某一项时触发
|
* 在多选模式下有效,选中某一项时触发
|
||||||
* selection:已选项数据
|
* selection:已选项数据
|
||||||
* row:刚选择的项数据
|
* row:刚选择的项数据
|
||||||
*/
|
*/
|
||||||
$emit(eventName: 'on-select', selection: object[], row: object): this;
|
$emit(eventName: "on-select", selection: object[], row: object): this;
|
||||||
/**
|
/**
|
||||||
* 在多选模式下有效,取消选中某一项时触发
|
* 在多选模式下有效,取消选中某一项时触发
|
||||||
* selection:已选项数据
|
* selection:已选项数据
|
||||||
* row:取消选择的项数据
|
* row:取消选择的项数据
|
||||||
*/
|
*/
|
||||||
$emit(eventName: 'on-select-cancel', selection: object[], row: object): this;
|
$emit(
|
||||||
|
eventName: "on-select-cancel",
|
||||||
|
selection: object[],
|
||||||
|
row: object
|
||||||
|
): this;
|
||||||
/**
|
/**
|
||||||
* 在多选模式下有效,点击全选时触发
|
* 在多选模式下有效,点击全选时触发
|
||||||
* selection:已选项数据
|
* selection:已选项数据
|
||||||
*/
|
*/
|
||||||
$emit(eventName: 'on-select-all', selection: object[]): this;
|
$emit(eventName: "on-select-all", selection: object[]): this;
|
||||||
/**
|
/**
|
||||||
* 在多选模式下有效,只要选中项发生变化时就会触发
|
* 在多选模式下有效,只要选中项发生变化时就会触发
|
||||||
* selection:已选项数据
|
* selection:已选项数据
|
||||||
*/
|
*/
|
||||||
$emit(eventName: 'on-selection-change', selection: object[]): this;
|
$emit(eventName: "on-selection-change", selection: object[]): this;
|
||||||
/**
|
/**
|
||||||
* 排序时有效,当点击排序时触发
|
* 排序时有效,当点击排序时触发
|
||||||
* column:当前列数据
|
* column:当前列数据
|
||||||
* key:排序依据的指标
|
* key:排序依据的指标
|
||||||
* order:排序的顺序,值为 asc 或 desc
|
* order:排序的顺序,值为 asc 或 desc
|
||||||
*/
|
*/
|
||||||
$emit(eventName: 'on-sort-change', column?: object, key?: string, order?: 'asc' | 'desc'): this;
|
$emit(
|
||||||
|
eventName: "on-sort-change",
|
||||||
|
column?: object,
|
||||||
|
key?: string,
|
||||||
|
order?: "asc" | "desc"
|
||||||
|
): this;
|
||||||
/**
|
/**
|
||||||
* 筛选时有效,筛选条件发生变化时触发 当前列数据
|
* 筛选时有效,筛选条件发生变化时触发 当前列数据
|
||||||
*/
|
*/
|
||||||
$emit(eventName: 'on-filter-change', value: any): this;
|
$emit(eventName: "on-filter-change", value: any): this;
|
||||||
/**
|
/**
|
||||||
* 单击某一行时触发
|
* 单击某一行时触发
|
||||||
* currentRow:当前行的数据
|
* currentRow:当前行的数据
|
||||||
* index?: 当前行的索引
|
* index?: 当前行的索引
|
||||||
*/
|
*/
|
||||||
$emit(eventName: 'on-row-click', currentRow: object, index: number): this;
|
$emit(eventName: "on-row-click", currentRow: object, index: number): this;
|
||||||
/**
|
/**
|
||||||
* 双击某一行时触发
|
* 双击某一行时触发
|
||||||
* currentRow:当前行的数据
|
* currentRow:当前行的数据
|
||||||
* index?: 当前行的索引
|
* index?: 当前行的索引
|
||||||
*/
|
*/
|
||||||
$emit(eventName: 'on-row-dblclick', currentRow: object, index: number): this;
|
$emit(
|
||||||
|
eventName: "on-row-dblclick",
|
||||||
|
currentRow: object,
|
||||||
|
index: number
|
||||||
|
): this;
|
||||||
/**
|
/**
|
||||||
* 展开或收起某一行时触发
|
* 展开或收起某一行时触发
|
||||||
* row:当前行的数据
|
* row:当前行的数据
|
||||||
* status:当前的状态
|
* status:当前的状态
|
||||||
*/
|
*/
|
||||||
$emit(eventName: 'on-expand', row: object, status: string): this;
|
$emit(eventName: "on-expand", row: object, status: string): this;
|
||||||
/**
|
/**
|
||||||
* 导出数据
|
* 导出数据
|
||||||
*/
|
*/
|
||||||
|
@ -167,7 +184,7 @@ export declare interface TableColumn {
|
||||||
/**
|
/**
|
||||||
* 列类型,可选值为 index、selection、expand、html
|
* 列类型,可选值为 index、selection、expand、html
|
||||||
*/
|
*/
|
||||||
type?: 'index' | 'selection' | 'expand' | 'html';
|
type?: "index" | "selection" | "expand" | "html";
|
||||||
/**
|
/**
|
||||||
* 列头显示文字
|
* 列头显示文字
|
||||||
* @default #
|
* @default #
|
||||||
|
@ -193,7 +210,7 @@ export declare interface TableColumn {
|
||||||
* 对齐方式,可选值为 left 左对齐、right 右对齐和 center 居中对齐,默认 left
|
* 对齐方式,可选值为 left 左对齐、right 右对齐和 center 居中对齐,默认 left
|
||||||
* @default left
|
* @default left
|
||||||
*/
|
*/
|
||||||
align?: 'left' | 'right' | 'center';
|
align?: "left" | "right" | "center";
|
||||||
/**
|
/**
|
||||||
* 列的样式名称
|
* 列的样式名称
|
||||||
*/
|
*/
|
||||||
|
@ -201,7 +218,7 @@ export declare interface TableColumn {
|
||||||
/**
|
/**
|
||||||
* 列是否固定在左侧或者右侧,可选值为 left 左侧和 right 右侧
|
* 列是否固定在左侧或者右侧,可选值为 left 左侧和 right 右侧
|
||||||
*/
|
*/
|
||||||
fixed?: 'left' | 'right';
|
fixed?: "left" | "right";
|
||||||
/**
|
/**
|
||||||
* 开启后,文本将不换行,超出部分显示为省略号
|
* 开启后,文本将不换行,超出部分显示为省略号
|
||||||
* @default false
|
* @default false
|
||||||
|
@ -217,24 +234,20 @@ export declare interface TableColumn {
|
||||||
* 传入两个参数,第一个是 h,第二个为对象,包含 row、column 和 index,
|
* 传入两个参数,第一个是 h,第二个为对象,包含 row、column 和 index,
|
||||||
* 分别指当前行数据,当前列数据,当前行索引,详见示例。
|
* 分别指当前行数据,当前列数据,当前行索引,详见示例。
|
||||||
* 学习 Render 函数的内容 从 rc.18 版本开始,我们将不再支持旧的用法。旧的 render 函数已被废弃。
|
* 学习 Render 函数的内容 从 rc.18 版本开始,我们将不再支持旧的用法。旧的 render 函数已被废弃。
|
||||||
|
* @param h Render函数
|
||||||
|
* @param params 对象,包含 row、column 和 index
|
||||||
*/
|
*/
|
||||||
render?: (h?:
|
render?: (
|
||||||
(
|
h?: CreateElement,
|
||||||
el?: string | object | Function,
|
|
||||||
data?: string | TableRenderCreateElementData | TableRenderCreateElementResult | Array<TableRenderCreateElementResult>,
|
|
||||||
vnode?: string | TableRenderCreateElementResult[]
|
|
||||||
) => TableRenderCreateElementResult,
|
|
||||||
params?: TableColumnRenderParams
|
params?: TableColumnRenderParams
|
||||||
) => TableRenderCreateElementResult;
|
) => TableRenderCreateElementResult;
|
||||||
/**
|
/**
|
||||||
* 自定义列头显示内容,传入参数有两个,column 和 index,分别为当前列数据和当前列索引,不支持渲染自定义组件
|
* 自定义列头显示内容,传入参数有两个,column 和 index,分别为当前列数据和当前列索引,不支持渲染自定义组件
|
||||||
|
* @param h Render函数
|
||||||
|
* @param params 对象,包含 row、column 和 index
|
||||||
*/
|
*/
|
||||||
renderHeader?: (h?:
|
renderHeader?: (
|
||||||
(
|
h?: CreateElement,
|
||||||
el?: string | object | Function,
|
|
||||||
data?: string | TableRenderCreateElementData | TableRenderCreateElementResult | Array<TableRenderCreateElementResult>,
|
|
||||||
vnode?: string | TableRenderCreateElementResult[]
|
|
||||||
) => TableRenderCreateElementResult,
|
|
||||||
params?: TableColumnRenderHeadParams
|
params?: TableColumnRenderHeadParams
|
||||||
) => TableRenderCreateElementResult;
|
) => TableRenderCreateElementResult;
|
||||||
/**
|
/**
|
||||||
|
@ -242,20 +255,20 @@ export declare interface TableColumn {
|
||||||
* 需要监听 Table 的 on- sort - change 事件,默认false
|
* 需要监听 Table 的 on- sort - change 事件,默认false
|
||||||
* @default false
|
* @default false
|
||||||
*/
|
*/
|
||||||
sortable?: boolean | 'custom';
|
sortable?: boolean | "custom";
|
||||||
/**
|
/**
|
||||||
* 自定义排序使用的方法,接收三个参数 a 、 b 和 type,
|
* 自定义排序使用的方法,接收三个参数 a 、 b 和 type,
|
||||||
* 当设置 sortable?: true 时有效。type 值为 asc 和 desc
|
* 当设置 sortable?: true 时有效。type 值为 asc 和 desc
|
||||||
*/
|
*/
|
||||||
sortMethod?: (a: any, b: any, type: 'asc' | 'desc') => void;
|
sortMethod?: (a: any, b: any, type: "asc" | "desc") => void;
|
||||||
/**
|
/**
|
||||||
* 设置初始化排序。值为 asc 和 desc
|
* 设置初始化排序。值为 asc 和 desc
|
||||||
*/
|
*/
|
||||||
sortType?: 'asc' | 'desc';
|
sortType?: "asc" | "desc";
|
||||||
/**
|
/**
|
||||||
* 过滤数据的选项,格式为数组,数组中每项包含 label 和 value 属性,使用过滤,必须同时配置filterMethod
|
* 过滤数据的选项,格式为数组,数组中每项包含 label 和 value 属性,使用过滤,必须同时配置filterMethod
|
||||||
*/
|
*/
|
||||||
filters?: { label: string, value: string | number | boolean }[];
|
filters?: { label: string; value: string | number | boolean }[];
|
||||||
/**
|
/**
|
||||||
* 数据过滤使用的方法,如果是多选的筛选项,对每一条数据会执行多次,任意一次返回 true 就会显示
|
* 数据过滤使用的方法,如果是多选的筛选项,对每一条数据会执行多次,任意一次返回 true 就会显示
|
||||||
*/
|
*/
|
||||||
|
@ -283,7 +296,7 @@ export declare interface TableRenderCreateElementData {
|
||||||
/**
|
/**
|
||||||
* 和`v-bind:class`一样的 API
|
* 和`v-bind:class`一样的 API
|
||||||
*/
|
*/
|
||||||
'class'?: object;
|
class?: object;
|
||||||
/**
|
/**
|
||||||
* 和`v-bind:style`一样的 API
|
* 和`v-bind:style`一样的 API
|
||||||
*/
|
*/
|
||||||
|
@ -291,7 +304,7 @@ export declare interface TableRenderCreateElementData {
|
||||||
/**
|
/**
|
||||||
* 正常的 HTML 特性
|
* 正常的 HTML 特性
|
||||||
*/
|
*/
|
||||||
attrs?: object,
|
attrs?: object;
|
||||||
/**
|
/**
|
||||||
* 组件 props
|
* 组件 props
|
||||||
*/
|
*/
|
||||||
|
@ -326,7 +339,7 @@ export declare interface TableRenderCreateElementData {
|
||||||
/**
|
/**
|
||||||
* myRef
|
* myRef
|
||||||
*/
|
*/
|
||||||
ref?: string
|
ref?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export declare interface TableColumnRenderParams {
|
export declare interface TableColumnRenderParams {
|
||||||
|
@ -413,7 +426,3 @@ export declare interface TableExportCsvParams {
|
||||||
*/
|
*/
|
||||||
quoted?: boolean;
|
quoted?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
19
types/tree.d.ts
vendored
19
types/tree.d.ts
vendored
|
@ -2,7 +2,7 @@
|
||||||
// Project: https://github.com/iview/iview
|
// Project: https://github.com/iview/iview
|
||||||
// Definitions by: yangdan
|
// Definitions by: yangdan
|
||||||
// Definitions: https://github.com/yangdan8/iview.git
|
// Definitions: https://github.com/yangdan8/iview.git
|
||||||
import Vue, { VNode } from 'vue';
|
import Vue, { VNode, CreateElement } from "vue";
|
||||||
|
|
||||||
export declare interface Tree extends Vue {
|
export declare interface Tree extends Vue {
|
||||||
/**
|
/**
|
||||||
|
@ -18,40 +18,41 @@ export declare interface Tree extends Vue {
|
||||||
* 是否显示多选框
|
* 是否显示多选框
|
||||||
* @default false
|
* @default false
|
||||||
*/
|
*/
|
||||||
'show-checkbox'?: boolean;
|
"show-checkbox"?: boolean;
|
||||||
/**
|
/**
|
||||||
* 没有数据时的提示
|
* 没有数据时的提示
|
||||||
* @default 暂无数据
|
* @default 暂无数据
|
||||||
*/
|
*/
|
||||||
'empty-text'?: string;
|
"empty-text"?: string;
|
||||||
/**
|
/**
|
||||||
* 异步加载数据的方法
|
* 异步加载数据的方法
|
||||||
*/
|
*/
|
||||||
'load-data'?: () => void;
|
"load-data"?: () => void;
|
||||||
/**
|
/**
|
||||||
* 自定义渲染内容
|
* 自定义渲染内容
|
||||||
|
* @param h Render函数
|
||||||
*/
|
*/
|
||||||
render?: () => void;
|
render?: (h?: CreateElement) => void;
|
||||||
/**
|
/**
|
||||||
* 定义子节点键
|
* 定义子节点键
|
||||||
* @default children
|
* @default children
|
||||||
*/
|
*/
|
||||||
'children-key'?:string;
|
"children-key"?: string;
|
||||||
/**
|
/**
|
||||||
* 点击树节点时触发
|
* 点击树节点时触发
|
||||||
* @default 当前已选中的节点数组
|
* @default 当前已选中的节点数组
|
||||||
*/
|
*/
|
||||||
$emit(eventName: 'on-select-change', value: TreeChild[]): this;
|
$emit(eventName: "on-select-change", value: TreeChild[]): this;
|
||||||
/**
|
/**
|
||||||
* 点击复选框时触发
|
* 点击复选框时触发
|
||||||
* @default 当前已勾选节点的数组
|
* @default 当前已勾选节点的数组
|
||||||
*/
|
*/
|
||||||
$emit(eventName: 'on-check-change', value: TreeChild[]): this;
|
$emit(eventName: "on-check-change", value: TreeChild[]): this;
|
||||||
/**
|
/**
|
||||||
* 展开和收起子列表时触发
|
* 展开和收起子列表时触发
|
||||||
* @default 当前节点的数据
|
* @default 当前节点的数据
|
||||||
*/
|
*/
|
||||||
$emit(eventName: 'on-toggle-expand', value: TreeChild): this;
|
$emit(eventName: "on-toggle-expand", value: TreeChild): this;
|
||||||
/**
|
/**
|
||||||
* 获取被勾选的节点
|
* 获取被勾选的节点
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Add table
Reference in a new issue