Commit a0059e4570d68a65f417803f76a5220d3134d218

Authored by yangdan8
Committed by GitHub
2 parents 33b3672e 41c71278

Merge pull request #27 from iview/2.0

update
examples/routers/tabs.vue
1 <template> 1 <template>
2 - <Tabs type="card" :animated="true" closable @on-tab-remove="handleTabRemove" :beforeRemove="handleBeforeRemove">  
3 - <Wrapper>  
4 - <TabPane label="标签一" v-if="tab0">标签一的内容</TabPane>  
5 - <TabPane label="标签二" v-if="tab1">标签二的内容</TabPane>  
6 - <TabPane label="标签三" v-if="tab2">标签三的内容</TabPane>  
7 - </Wrapper>  
8 - </Tabs>  
9 -  
10 - <!--<Tabs type="card" :animated="true" closable @on-tab-remove="handleTabRemove" :beforeRemove="handleBeforeRemove">-->  
11 - <!--<TabPane label="标签一" v-if="tab0">标签一的内容</TabPane>-->  
12 - <!--<TabPane label="标签二" v-if="tab1">标签二的内容</TabPane>-->  
13 - <!--<TabPane label="标签三" v-if="tab2">标签三的内容</TabPane>-->  
14 - <!--</Tabs>--> 2 + <div>
  3 + <Button @click="showSecond = !showSecond">change</Button>
  4 + <Tabs value="name1">
  5 + <TabPane label="标签一" name="name1" :index="1">标签一的内容</TabPane>
  6 + <TabPane label="标签二" name="name2" :index="2" v-if="showSecond">标签二的内容</TabPane>
  7 + <TabPane label="标签三" name="name3" :index="3">标签三的内容</TabPane>
  8 + </Tabs>
  9 + </div>
15 </template> 10 </template>
16 <script> 11 <script>
17 - import Wrapper from '../components/wrapper.vue';  
18 export default { 12 export default {
19 - components: { Wrapper },  
20 data () { 13 data () {
21 return { 14 return {
22 - tab0: true,  
23 - tab1: true,  
24 - tab2: true  
25 - }  
26 - },  
27 - methods: {  
28 - handleTabRemove (name) {  
29 - this['tab' + name] = false;  
30 - },  
31 - handleBeforeRemove (index) {  
32 - console.log(index);  
33 -  
34 - return new Promise((resolve, reject) => {  
35 - this.$Modal.confirm({  
36 - title: 'Title',  
37 - content: '<p>Content of dialog</p><p>Content of dialog</p>',  
38 - onOk: () => {  
39 - resolve();  
40 - },  
41 - onCancel: () => {  
42 - reject();  
43 - }  
44 - });  
45 - }); 15 + showSecond: false
46 } 16 }
47 } 17 }
48 } 18 }
src/components/affix/affix.vue
@@ -80,6 +80,9 @@ @@ -80,6 +80,9 @@
80 // window.addEventListener('resize', this.handleScroll, false); 80 // window.addEventListener('resize', this.handleScroll, false);
81 on(window, 'scroll', this.handleScroll); 81 on(window, 'scroll', this.handleScroll);
82 on(window, 'resize', this.handleScroll); 82 on(window, 'resize', this.handleScroll);
  83 + this.$nextTick(() => {
  84 + this.handleScroll();
  85 + });
83 }, 86 },
84 beforeDestroy () { 87 beforeDestroy () {
85 // window.removeEventListener('scroll', this.handleScroll, false); 88 // window.removeEventListener('scroll', this.handleScroll, false);
src/components/form/form-item.vue
@@ -84,9 +84,12 @@ @@ -84,9 +84,12 @@
84 }; 84 };
85 }, 85 },
86 watch: { 86 watch: {
87 - error (val) {  
88 - this.validateMessage = val;  
89 - this.validateState = val === '' ? '' : 'error'; 87 + error: {
  88 + handler (val) {
  89 + this.validateMessage = val;
  90 + this.validateState = val ? 'error' : '';
  91 + },
  92 + immediate: true
90 }, 93 },
91 validateStatus (val) { 94 validateStatus (val) {
92 this.validateState = val; 95 this.validateState = val;
src/components/input/input.vue
@@ -85,7 +85,7 @@ @@ -85,7 +85,7 @@
85 props: { 85 props: {
86 type: { 86 type: {
87 validator (value) { 87 validator (value) {
88 - return oneOf(value, ['text', 'textarea', 'password', 'url', 'email', 'date', 'number']); 88 + return oneOf(value, ['text', 'textarea', 'password', 'url', 'email', 'date', 'number', 'tel']);
89 }, 89 },
90 default: 'text' 90 default: 'text'
91 }, 91 },
src/components/tabs/pane.vue
@@ -30,6 +30,11 @@ @@ -30,6 +30,11 @@
30 tab: { 30 tab: {
31 type: String 31 type: String
32 }, 32 },
  33 + // 在 TabPane 使用 v-if 时,并不会按照预先的顺序渲染,这时可设置 index,并从小到大排序
  34 + // 数值需大于 0
  35 + index: {
  36 + type: Number
  37 + }
33 }, 38 },
34 data () { 39 data () {
35 return { 40 return {
src/components/tabs/tabs.vue
@@ -187,6 +187,14 @@ @@ -187,6 +187,14 @@
187 } 187 }
188 }); 188 });
189 189
  190 + // 在 TabPane 使用 v-if 时,并不会按照预先的顺序渲染,这时可设置 index,并从小到大排序
  191 + TabPanes.sort((a, b) => {
  192 + if (a.index && b.index) {
  193 + return a.index > b.index ? 1 : -1;
  194 + } else {
  195 + return 1;
  196 + }
  197 + });
190 return TabPanes; 198 return TabPanes;
191 }, 199 },
192 updateNav () { 200 updateNav () {
src/styles/components/drawer.less
@@ -96,6 +96,10 @@ @@ -96,6 +96,10 @@
96 96
97 &-no-mask{ 97 &-no-mask{
98 pointer-events: none; 98 pointer-events: none;
  99 +
  100 + .@{drawer-prefix-cls}-drag{
  101 + pointer-events: auto;
  102 + }
99 } 103 }
100 104
101 &-drag{ 105 &-drag{
test/unit/specs/affix.spec.js 0 → 100644
  1 +import { createVue, destroyVM } from '../util';
  2 +
  3 +describe('Affix.vue', () => {
  4 + let vm;
  5 + afterEach(() => {
  6 + destroyVM(vm);
  7 + });
  8 +
  9 + it('should create a Affix component without slot', done => {
  10 + vm = createVue('<Affix></Affix>');
  11 + const affix = vm.$el.children[0];
  12 +
  13 + expect(affix.tagName).to.equal('DIV');
  14 + expect(affix.className).to.equal('');
  15 + done();
  16 + });
  17 +
  18 + it('should create a Affix component contain slot', done => {
  19 + vm = createVue(`
  20 + <Affix>
  21 + <span class="demo-affix">Fixed at the top</span>
  22 + </Affix>
  23 + `);
  24 + const slot = vm.$el.children[0].children[0];
  25 +
  26 + expect(slot.tagName).to.equal('SPAN');
  27 + expect(slot.className).to.equal('demo-affix');
  28 + done();
  29 + });
  30 +
  31 + it('only set offset-top props', done => {
  32 + vm = createVue(`
  33 + <div>
  34 + <Affix :offset-top="20">
  35 + <span class="demo-affix">Fixed at the top</span>
  36 + </Affix>
  37 + <div style="width: 100%; height: 2000px"></div>
  38 + </div>
  39 + `, true);
  40 + const affix = vm.$el.children[0].children[0];
  41 + const fakeBlock = vm.$el.children[0].children[1];
  42 +
  43 + expect(affix.classList.contains('ivu-affix')).to.false;
  44 + expect(affix.style.top).to.equal('');
  45 + expect(fakeBlock.style.display).to.equal('none');
  46 + window.scrollTo(0, 10000);
  47 + setTimeout(()=>{
  48 + expect(affix.classList.contains('ivu-affix')).to.true;
  49 + expect(affix.style.top).to.equal('20px');
  50 + expect(fakeBlock.style.display).to.equal('');
  51 + done();
  52 + }, 100);
  53 + });
  54 +
  55 + it('only set offset-bottom props', done => {
  56 + vm = createVue(`
  57 + <div>
  58 + <div style="width: 100%; height: 2000px"></div>
  59 + <Affix :offset-bottom="20">
  60 + <span class="demo-affix">Fixed at the top</span>
  61 + </Affix>
  62 + <div style="width: 100%; height: 2000px"></div>
  63 + </div>
  64 + `, true);
  65 + const affix = vm.$el.children[1].children[0];
  66 +
  67 + expect(affix.classList.contains('ivu-affix')).to.false;
  68 + expect(affix.style.bottom).to.equal('');
  69 + // Affix component haven't run handleScroll function when component mounted in real dom.
  70 + // use scrollTo() to trigger scroll event.
  71 + window.scrollTo(0, 100);
  72 + setTimeout(()=>{
  73 + expect(affix.classList.contains('ivu-affix')).to.true;
  74 + expect(affix.style.bottom).to.equal('20px');
  75 + window.scrollTo(0, 10000);
  76 + setTimeout(()=>{
  77 + expect(affix.classList.contains('ivu-affix')).to.false;
  78 + expect(affix.style.bottom).to.equal('');
  79 + done();
  80 + }, 100);
  81 + }, 100);
  82 + });
  83 +
  84 + it('both props are set, only offset-bottom is valid', done => {
  85 + vm = createVue(`
  86 + <div>
  87 + <div style="width: 100%; height: 2000px"></div>
  88 + <Affix :offset-bottom="20" :offset-top="20">
  89 + <span class="demo-affix">Fixed at the top</span>
  90 + </Affix>
  91 + <div style="width: 100%; height: 2000px"></div>
  92 + </div>
  93 + `, true);
  94 + const affix = vm.$el.children[1].children[0];
  95 +
  96 + expect(affix.classList.contains('ivu-affix')).to.false;
  97 + expect(affix.style.bottom).to.equal('');
  98 + // Affix component haven't run handleScroll function when component mounted in real dom.
  99 + // use scrollTo() to trigger scroll event.
  100 + window.scrollTo(0, 100);
  101 + setTimeout(()=>{
  102 + expect(affix.classList.contains('ivu-affix')).to.true;
  103 + expect(affix.style.bottom).to.equal('20px');
  104 + window.scrollTo(0, 10000);
  105 + setTimeout(()=>{
  106 + expect(affix.classList.contains('ivu-affix')).to.false;
  107 + expect(affix.style.bottom).to.equal('');
  108 + done();
  109 + }, 100);
  110 + }, 100);
  111 + });
  112 +
  113 + it('both props are not set, should fixed top and top equal 0px', done => {
  114 + vm = createVue(`
  115 + <div>
  116 + <Affix>
  117 + <span class="demo-affix">Fixed at the top</span>
  118 + </Affix>
  119 + <div style="width: 100%; height: 2000px"></div>
  120 + </div>
  121 + `, true);
  122 + const affix = vm.$el.children[0].children[0];
  123 + const fakeBlock = vm.$el.children[0].children[1];
  124 +
  125 + expect(affix.classList.contains('ivu-affix')).to.false;
  126 + expect(affix.style.top).to.equal('');
  127 + expect(fakeBlock.style.display).to.equal('none');
  128 + window.scrollTo(0, 10000);
  129 + setTimeout(()=>{
  130 + expect(affix.classList.contains('ivu-affix')).to.true;
  131 + expect(affix.style.top).to.equal('0px');
  132 + expect(fakeBlock.style.display).to.equal('');
  133 + done();
  134 + }, 100);
  135 + });
  136 +
  137 +});
0 \ No newline at end of file 138 \ No newline at end of file
1 -// Type definitions for iview 3.1.0 1 +// Type definitions for iview 3.3.0
2 // Project: https://github.com/iview/iview 2 // Project: https://github.com/iview/iview
3 // Definitions by: yangdan 3 // Definitions by: yangdan
4 // Definitions: https://github.com/yangdan8/iview.git 4 // Definitions: https://github.com/yangdan8/iview.git
1 -// Type definitions for iview 3.1.0 1 +// Type definitions for iview 3.3.0
2 // Project: https://github.com/iview/iview 2 // Project: https://github.com/iview/iview
3 // Definitions by: yangdan 3 // Definitions by: yangdan
4 // Definitions: https://github.com/yangdan8/iview.git 4 // Definitions: https://github.com/yangdan8/iview.git
1 -// Type definitions for iview 3.1.0 1 +// Type definitions for iview 3.3.0
2 // Project: https://github.com/iview/iview 2 // Project: https://github.com/iview/iview
3 // Definitions by: yangdan 3 // Definitions by: yangdan
4 // Definitions: https://github.com/yangdan8/iview.git 4 // Definitions: https://github.com/yangdan8/iview.git
types/auto-complete.d.ts
1 -// Type definitions for iview 3.1.0 1 +// Type definitions for iview 3.3.0
2 // Project: https://github.com/iview/iview 2 // Project: https://github.com/iview/iview
3 // Definitions by: yangdan 3 // Definitions by: yangdan
4 // Definitions: https://github.com/yangdan8/iview.git 4 // Definitions: https://github.com/yangdan8/iview.git
@@ -72,4 +72,8 @@ export declare interface AutoComplete extends Vue { @@ -72,4 +72,8 @@ export declare interface AutoComplete extends Vue {
72 * 搜索补全项的时候调用 72 * 搜索补全项的时候调用
73 */ 73 */
74 $emit(eventName: 'on-blur', event: KeyboardEvent): this; 74 $emit(eventName: 'on-blur', event: KeyboardEvent): this;
  75 + /**
  76 + * 清空时触发
  77 + */
  78 + $emit(eventName: 'on-clear'): this;
75 } 79 }
1 -// Type definitions for iview 3.1.0 1 +// Type definitions for iview 3.3.0
2 // Project: https://github.com/iview/iview 2 // Project: https://github.com/iview/iview
3 // Definitions by: yangdan 3 // Definitions by: yangdan
4 // Definitions: https://github.com/yangdan8/iview.git 4 // Definitions: https://github.com/yangdan8/iview.git
@@ -27,4 +27,8 @@ export declare interface Avatar extends Vue { @@ -27,4 +27,8 @@ export declare interface Avatar extends Vue {
27 * 自定义图标 27 * 自定义图标
28 */ 28 */
29 'custom-icon'?: string; 29 'custom-icon'?: string;
  30 + /**
  31 + * 在设置 src 且图片加载不成功时触发
  32 + */
  33 + $emit(eventName: 'on-error', event: Event): this;
30 } 34 }
31 \ No newline at end of file 35 \ No newline at end of file
types/back-top.d.ts
1 -// Type definitions for iview 3.1.0 1 +// Type definitions for iview 3.3.0
2 // Project: https://github.com/iview/iview 2 // Project: https://github.com/iview/iview
3 // Definitions by: yangdan 3 // Definitions by: yangdan
4 // Definitions: https://github.com/yangdan8/iview.git 4 // Definitions: https://github.com/yangdan8/iview.git
1 -// Type definitions for iview 3.1.0 1 +// Type definitions for iview 3.3.0
2 // Project: https://github.com/iview/iview 2 // Project: https://github.com/iview/iview
3 // Definitions by: yangdan 3 // Definitions by: yangdan
4 // Definitions: https://github.com/yangdan8/iview.git 4 // Definitions: https://github.com/yangdan8/iview.git
types/breadcrumb.d.ts
1 -// Type definitions for iview 3.1.0 1 +// Type definitions for iview 3.3.0
2 // Project: https://github.com/iview/iview 2 // Project: https://github.com/iview/iview
3 // Definitions by: yangdan 3 // Definitions by: yangdan
4 // Definitions: https://github.com/yangdan8/iview.git 4 // Definitions: https://github.com/yangdan8/iview.git
1 -// Type definitions for iview 3.1.0 1 +// Type definitions for iview 3.3.0
2 // Project: https://github.com/iview/iview 2 // Project: https://github.com/iview/iview
3 // Definitions by: yangdan 3 // Definitions by: yangdan
4 // Definitions: https://github.com/yangdan8/iview.git 4 // Definitions: https://github.com/yangdan8/iview.git
1 -// Type definitions for iview 3.1.0 1 +// Type definitions for iview 3.3.0
2 // Project: https://github.com/iview/iview 2 // Project: https://github.com/iview/iview
3 // Definitions by: yangdan 3 // Definitions by: yangdan
4 // Definitions: https://github.com/yangdan8/iview.git 4 // Definitions: https://github.com/yangdan8/iview.git
types/carousel.d.ts
1 -// Type definitions for iview 3.1.0 1 +// Type definitions for iview 3.3.0
2 // Project: https://github.com/iview/iview 2 // Project: https://github.com/iview/iview
3 // Definitions by: yangdan 3 // Definitions by: yangdan
4 // Definitions: https://github.com/yangdan8/iview.git 4 // Definitions: https://github.com/yangdan8/iview.git
types/cascader.d.ts
1 -// Type definitions for iview 3.1.0 1 +// Type definitions for iview 3.3.0
2 // Project: https://github.com/iview/iview 2 // Project: https://github.com/iview/iview
3 // Definitions by: yangdan 3 // Definitions by: yangdan
4 // Definitions: https://github.com/yangdan8/iview.git 4 // Definitions: https://github.com/yangdan8/iview.git
1 -// Type definitions for iview 3.1.0 1 +// Type definitions for iview 3.3.0
2 // Project: https://github.com/iview/iview 2 // Project: https://github.com/iview/iview
3 // Definitions by: yangdan 3 // Definitions by: yangdan
4 // Definitions: https://github.com/yangdan8/iview.git 4 // Definitions: https://github.com/yangdan8/iview.git
types/checkbox.d.ts
1 -// Type definitions for iview 3.1.0 1 +// Type definitions for iview 3.3.0
2 // Project: https://github.com/iview/iview 2 // Project: https://github.com/iview/iview
3 // Definitions by: yangdan 3 // Definitions by: yangdan
4 // Definitions: https://github.com/yangdan8/iview.git 4 // Definitions: https://github.com/yangdan8/iview.git
1 -// Type definitions for iview 3.1.0 1 +// Type definitions for iview 3.3.0
2 // Project: https://github.com/iview/iview 2 // Project: https://github.com/iview/iview
3 // Definitions by: yangdan 3 // Definitions by: yangdan
4 // Definitions: https://github.com/yangdan8/iview.git 4 // Definitions: https://github.com/yangdan8/iview.git
types/collapse.d.ts
1 -// Type definitions for iview 3.1.0 1 +// Type definitions for iview 3.3.0
2 // Project: https://github.com/iview/iview 2 // Project: https://github.com/iview/iview
3 // Definitions by: yangdan 3 // Definitions by: yangdan
4 // Definitions: https://github.com/yangdan8/iview.git 4 // Definitions: https://github.com/yangdan8/iview.git
types/color-picker.d.ts
1 -// Type definitions for iview 3.1.0 1 +// Type definitions for iview 3.3.0
2 // Project: https://github.com/iview/iview 2 // Project: https://github.com/iview/iview
3 // Definitions by: yangdan 3 // Definitions by: yangdan
4 // Definitions: https://github.com/yangdan8/iview.git 4 // Definitions: https://github.com/yangdan8/iview.git
types/content.d.ts
1 -// Type definitions for iview 3.1.0 1 +// Type definitions for iview 3.3.0
2 // Project: https://github.com/iview/iview 2 // Project: https://github.com/iview/iview
3 // Definitions by: yangdan 3 // Definitions by: yangdan
4 // Definitions: https://github.com/yangdan8/iview.git 4 // Definitions: https://github.com/yangdan8/iview.git
types/date-picker.d.ts
1 -// Type definitions for iview 3.1.0 1 +// Type definitions for iview 3.3.0
2 // Project: https://github.com/iview/iview 2 // Project: https://github.com/iview/iview
3 // Definitions by: yangdan 3 // Definitions by: yangdan
4 // Definitions: https://github.com/yangdan8/iview.git 4 // Definitions: https://github.com/yangdan8/iview.git
@@ -112,6 +112,10 @@ export declare interface DatePicker extends Vue { @@ -112,6 +112,10 @@ export declare interface DatePicker extends Vue {
112 */ 112 */
113 'time-picker-options'?: object; 113 'time-picker-options'?: object;
114 /** 114 /**
  115 + * 两个日期间的分隔符
  116 + */
  117 + 'separator'?: string;
  118 + /**
115 * 日期发生变化时触发 已经格式化后的日期,比如 2016-01-01 119 * 日期发生变化时触发 已经格式化后的日期,比如 2016-01-01
116 */ 120 */
117 $emit(eventName: 'on-change', value: string): this; 121 $emit(eventName: 'on-change', value: string): this;
types/divider.d.ts
1 -// Type definitions for iview 3.1.0 1 +// Type definitions for iview 3.3.0
2 // Project: https://github.com/iview/iview 2 // Project: https://github.com/iview/iview
3 // Definitions by: yangdan 3 // Definitions by: yangdan
4 // Definitions: https://github.com/yangdan8/iview.git 4 // Definitions: https://github.com/yangdan8/iview.git
@@ -20,4 +20,9 @@ export declare interface Divider extends Vue { @@ -20,4 +20,9 @@ export declare interface Divider extends Vue {
20 * @default false 20 * @default false
21 */ 21 */
22 dashed?: boolean; 22 dashed?: boolean;
  23 + /**
  24 + * 尺寸,可选值为 small 或 default
  25 + * @default default
  26 + */
  27 + size?: string;
23 } 28 }
24 \ No newline at end of file 29 \ No newline at end of file
1 -// Type definitions for iview 3.1.0 1 +// Type definitions for iview 3.3.0
2 // Project: https://github.com/iview/iview 2 // Project: https://github.com/iview/iview
3 // Definitions by: yangdan 3 // Definitions by: yangdan
4 // Definitions: https://github.com/yangdan8/iview.git 4 // Definitions: https://github.com/yangdan8/iview.git
@@ -68,6 +68,15 @@ export declare interface Drawer extends Vue { @@ -68,6 +68,15 @@ export declare interface Drawer extends Vue {
68 */ 68 */
69 'inner'?: boolean; 69 'inner'?: boolean;
70 /** 70 /**
  71 + * 是否开启拖拽调整宽度
  72 + * @default false
  73 + */
  74 + 'draggable'?: boolean;
  75 + /**
  76 + * 返回 Promise 可以阻止关闭
  77 + */
  78 + 'before-close'?: () => void | PromiseConstructor;
  79 + /**
71 * 关闭抽屉时触发 80 * 关闭抽屉时触发
72 */ 81 */
73 $emit(eventName: 'on-close'): this; 82 $emit(eventName: 'on-close'): this;
@@ -76,6 +85,10 @@ export declare interface Drawer extends Vue { @@ -76,6 +85,10 @@ export declare interface Drawer extends Vue {
76 */ 85 */
77 $emit(eventName: 'on-visible-change', value: boolean): this; 86 $emit(eventName: 'on-visible-change', value: boolean): this;
78 /** 87 /**
  88 + * 调整宽度时触发,返回宽度
  89 + */
  90 + $emit(eventName: 'on-resize-width'): number;
  91 + /**
79 * slot插槽对象 92 * slot插槽对象
80 */ 93 */
81 $slots: { 94 $slots: {
@@ -91,5 +104,9 @@ export declare interface Drawer extends Vue { @@ -91,5 +104,9 @@ export declare interface Drawer extends Vue {
91 * 抽屉主体内容 104 * 抽屉主体内容
92 */ 105 */
93 close: VNode[]; 106 close: VNode[];
  107 + /**
  108 + * 自定义调整宽度节点
  109 + */
  110 + trigger: VNode[];
94 }; 111 };
95 } 112 }
types/dropdown.d.ts
1 -// Type definitions for iview 3.1.0 1 +// Type definitions for iview 3.3.0
2 // Project: https://github.com/iview/iview 2 // Project: https://github.com/iview/iview
3 // Definitions by: yangdan 3 // Definitions by: yangdan
4 // Definitions: https://github.com/yangdan8/iview.git 4 // Definitions: https://github.com/yangdan8/iview.git
@@ -29,6 +29,10 @@ export declare interface Dropdown extends Vue { @@ -29,6 +29,10 @@ export declare interface Dropdown extends Vue {
29 */ 29 */
30 transfer?: boolean; 30 transfer?: boolean;
31 /** 31 /**
  32 + * 开启 transfer 时,给浮层添加额外的 class 名称
  33 + */
  34 + 'transfer-class-name'?: string;
  35 + /**
32 * 点击菜单项时触发 36 * 点击菜单项时触发
33 * 37 *
34 */ 38 */
1 -// Type definitions for iview 3.1.0 1 +// Type definitions for iview 3.3.0
2 // Project: https://github.com/iview/iview 2 // Project: https://github.com/iview/iview
3 // Definitions by: yangdan 3 // Definitions by: yangdan
4 // Definitions: https://github.com/yangdan8/iview.git 4 // Definitions: https://github.com/yangdan8/iview.git
1 -// Type definitions for iview 3.1.0 1 +// Type definitions for iview 3.3.0
2 // Project: https://github.com/iview/iview 2 // Project: https://github.com/iview/iview
3 // Definitions by: yangdan 3 // Definitions by: yangdan
4 // Definitions: https://github.com/yangdan8/iview.git 4 // Definitions: https://github.com/yangdan8/iview.git
1 -// Type definitions for iview 3.1.0 1 +// Type definitions for iview 3.3.0
2 // Project: https://github.com/iview/iview 2 // Project: https://github.com/iview/iview
3 // Definitions by: yangdan 3 // Definitions by: yangdan
4 // Definitions: https://github.com/yangdan8/iview.git 4 // Definitions: https://github.com/yangdan8/iview.git
1 -// Type definitions for iview 3.1.0 1 +// Type definitions for iview 3.3.0
2 // Project: https://github.com/iview/iview 2 // Project: https://github.com/iview/iview
3 // Definitions by: yangdan 3 // Definitions by: yangdan
4 // Definitions: https://github.com/yangdan8/iview.git 4 // Definitions: https://github.com/yangdan8/iview.git
1 -// Type definitions for iview 3.1.0 1 +// Type definitions for iview 3.3.0
2 // Project: https://github.com/iview/iview 2 // Project: https://github.com/iview/iview
3 // Definitions by: yangdan 3 // Definitions by: yangdan
4 // Definitions: https://github.com/yangdan8/iview.git 4 // Definitions: https://github.com/yangdan8/iview.git
1 -// Type definitions for iview 3.1.0 1 +// Type definitions for iview 3.3.0
2 // Project: https://github.com/iview/iview 2 // Project: https://github.com/iview/iview
3 // Definitions by: yangdan 3 // Definitions by: yangdan
4 // Definitions: https://github.com/yangdan8/iview.git 4 // Definitions: https://github.com/yangdan8/iview.git
types/input-number.d.ts
1 -// Type definitions for iview 3.1.0 1 +// Type definitions for iview 3.3.0
2 // Project: https://github.com/iview/iview 2 // Project: https://github.com/iview/iview
3 // Definitions by: yangdan 3 // Definitions by: yangdan
4 // Definitions: https://github.com/yangdan8/iview.git 4 // Definitions: https://github.com/yangdan8/iview.git
1 -// Type definitions for iview 3.1.0 1 +// Type definitions for iview 3.3.0
2 // Project: https://github.com/iview/iview 2 // Project: https://github.com/iview/iview
3 // Definitions by: yangdan 3 // Definitions by: yangdan
4 // Definitions: https://github.com/yangdan8/iview.git 4 // Definitions: https://github.com/yangdan8/iview.git
@@ -6,10 +6,10 @@ import Vue, { VNode } from &#39;vue&#39;; @@ -6,10 +6,10 @@ import Vue, { VNode } from &#39;vue&#39;;
6 6
7 export declare interface Input extends Vue { 7 export declare interface Input extends Vue {
8 /** 8 /**
9 - * 输入框类型,可选值为 text、password、textarea、url、email、date 9 + * 输入框类型,可选值为 text、password、textarea、url、email、date、number、tel
10 * @default text 10 * @default text
11 */ 11 */
12 - type?: 'text' | 'password' | 'textarea' | 'url' | 'email' | 'date'; 12 + type?: 'text' | 'password' | 'textarea' | 'url' | 'email' | 'date' | 'number' | 'tel';
13 /** 13 /**
14 * 绑定的值,可使用 v-model 双向绑定 14 * 绑定的值,可使用 v-model 双向绑定
15 * @default 空 15 * @default 空
types/iview.components.d.ts
1 -// Type definitions for iview 3.1.0 1 +// Type definitions for iview 3.3.0
2 // Project: https://github.com/iview/iview 2 // Project: https://github.com/iview/iview
3 // Definitions by: yangdan 3 // Definitions by: yangdan
4 // Definitions: https://github.com/yangdan8/iview.git 4 // Definitions: https://github.com/yangdan8/iview.git
1 -// Type definitions for iview 3.1.0 1 +// Type definitions for iview 3.3.0
2 // Project: https://github.com/iview/iview 2 // Project: https://github.com/iview/iview
3 // Definitions by: yangdan 3 // Definitions by: yangdan
4 // Definitions: https://github.com/yangdan8/iview.git 4 // Definitions: https://github.com/yangdan8/iview.git
@@ -8,11 +8,12 @@ export declare interface Layout extends Vue { @@ -8,11 +8,12 @@ export declare interface Layout extends Vue {
8 /** 8 /**
9 * 触发响应式布局的断点,可选值为xs,sm,md,lg,xl或xxl,若不设此属性则不会触发响应式布局。 9 * 触发响应式布局的断点,可选值为xs,sm,md,lg,xl或xxl,若不设此属性则不会触发响应式布局。
10 * { 10 * {
11 - * xs?: '480px',  
12 - * sm?: '768px',  
13 - * md?: '992px',  
14 - * lg?: '1200px',  
15 - * xl?: '1600px' 11 + * xs: '480px',
  12 + * sm: '576px',
  13 + * md: '768px',
  14 + * lg: '992px',
  15 + * xl: '1200px',
  16 + * xxl: '1600px'
16 * } 17 * }
17 */ 18 */
18 breakpoint?: string; 19 breakpoint?: string;
@@ -69,4 +70,4 @@ export declare interface Layout extends Vue { @@ -69,4 +70,4 @@ export declare interface Layout extends Vue {
69 * methods, 改变Sider展开-收起状态。 70 * methods, 改变Sider展开-收起状态。
70 */ 71 */
71 toggleCollapse(): void; 72 toggleCollapse(): void;
72 -}  
73 \ No newline at end of file 73 \ No newline at end of file
  74 +}更多·
74 \ No newline at end of file 75 \ No newline at end of file
types/loading-bar.d.ts
1 -// Type definitions for iview 3.1.0 1 +// Type definitions for iview 3.3.0
2 // Project: https://github.com/iview/iview 2 // Project: https://github.com/iview/iview
3 // Definitions by: yangdan 3 // Definitions by: yangdan
4 // Definitions: https://github.com/yangdan8/iview.git 4 // Definitions: https://github.com/yangdan8/iview.git
1 -// Type definitions for iview 3.1.0 1 +// Type definitions for iview 3.3.0
2 // Project: https://github.com/iview/iview 2 // Project: https://github.com/iview/iview
3 // Definitions by: yangdan 3 // Definitions by: yangdan
4 // Definitions: https://github.com/yangdan8/iview.git 4 // Definitions: https://github.com/yangdan8/iview.git
types/message.d.ts
1 -// Type definitions for iview 3.1.0 1 +// Type definitions for iview 3.3.0
2 // Project: https://github.com/iview/iview 2 // Project: https://github.com/iview/iview
3 // Definitions by: yangdan 3 // Definitions by: yangdan
4 // Definitions: https://github.com/yangdan8/iview.git 4 // Definitions: https://github.com/yangdan8/iview.git
1 -// Type definitions for iview 3.1.0 1 +// Type definitions for iview 3.3.0
2 // Project: https://github.com/iview/iview 2 // Project: https://github.com/iview/iview
3 // Definitions by: yangdan 3 // Definitions by: yangdan
4 // Definitions: https://github.com/yangdan8/iview.git 4 // Definitions: https://github.com/yangdan8/iview.git
1 -// Type definitions for iview 3.1.0 1 +// Type definitions for iview 3.3.0
2 // Project: https://github.com/iview/iview 2 // Project: https://github.com/iview/iview
3 // Definitions by: yangdan 3 // Definitions by: yangdan
4 // Definitions: https://github.com/yangdan8/iview.git 4 // Definitions: https://github.com/yangdan8/iview.git
1 -// Type definitions for iview 3.1.0 1 +// Type definitions for iview 3.3.0
2 // Project: https://github.com/iview/iview 2 // Project: https://github.com/iview/iview
3 // Definitions by: yangdan 3 // Definitions by: yangdan
4 // Definitions: https://github.com/yangdan8/iview.git 4 // Definitions: https://github.com/yangdan8/iview.git
1 -// Type definitions for iview 3.1.0 1 +// Type definitions for iview 3.3.0
2 // Project: https://github.com/iview/iview 2 // Project: https://github.com/iview/iview
3 // Definitions by: yangdan 3 // Definitions by: yangdan
4 // Definitions: https://github.com/yangdan8/iview.git 4 // Definitions: https://github.com/yangdan8/iview.git
types/progress.d.ts
1 -// Type definitions for iview 3.1.0 1 +// Type definitions for iview 3.3.0
2 // Project: https://github.com/iview/iview 2 // Project: https://github.com/iview/iview
3 // Definitions by: yangdan 3 // Definitions by: yangdan
4 // Definitions: https://github.com/yangdan8/iview.git 4 // Definitions: https://github.com/yangdan8/iview.git
@@ -36,6 +36,10 @@ export declare interface Progress extends Vue { @@ -36,6 +36,10 @@ export declare interface Progress extends Vue {
36 */ 36 */
37 'success-percent'?: number; 37 'success-percent'?: number;
38 /** 38 /**
  39 + * 进度条的颜色
  40 + */
  41 + 'stroke-color'?: string;
  42 + /**
39 * slot插槽对象 43 * slot插槽对象
40 */ 44 */
41 $slots: { 45 $slots: {
1 -// Type definitions for iview 3.1.0 1 +// Type definitions for iview 3.3.0
2 // Project: https://github.com/iview/iview 2 // Project: https://github.com/iview/iview
3 // Definitions by: yangdan 3 // Definitions by: yangdan
4 // Definitions: https://github.com/yangdan8/iview.git 4 // Definitions: https://github.com/yangdan8/iview.git
1 -// Type definitions for iview 3.1.0 1 +// Type definitions for iview 3.3.0
2 // Project: https://github.com/iview/iview 2 // Project: https://github.com/iview/iview
3 // Definitions by: yangdan 3 // Definitions by: yangdan
4 // Definitions: https://github.com/yangdan8/iview.git 4 // Definitions: https://github.com/yangdan8/iview.git
1 -// Type definitions for iview 3.1.0 1 +// Type definitions for iview 3.3.0
2 // Project: https://github.com/iview/iview 2 // Project: https://github.com/iview/iview
3 // Definitions by: yangdan 3 // Definitions by: yangdan
4 // Definitions: https://github.com/yangdan8/iview.git 4 // Definitions: https://github.com/yangdan8/iview.git
1 -// Type definitions for iview 3.1.0 1 +// Type definitions for iview 3.3.0
2 // Project: https://github.com/iview/iview 2 // Project: https://github.com/iview/iview
3 // Definitions by: yangdan 3 // Definitions by: yangdan
4 // Definitions: https://github.com/yangdan8/iview.git 4 // Definitions: https://github.com/yangdan8/iview.git
@@ -89,6 +89,10 @@ export declare interface Select extends Vue { @@ -89,6 +89,10 @@ export declare interface Select extends Vue {
89 */ 89 */
90 'element-id'?: string; 90 'element-id'?: string;
91 /** 91 /**
  92 + * 开启 transfer 时,给浮层添加额外的 class 名称
  93 + */
  94 + 'transfer-class-name'?: string;
  95 + /**
92 * 选中的Option变化时触发,默认返回 value,如需返回 label,详见 label-in-value 属性 当前选中项 96 * 选中的Option变化时触发,默认返回 value,如需返回 label,详见 label-in-value 属性 当前选中项
93 */ 97 */
94 $emit(eventName: 'on-change'): this; 98 $emit(eventName: 'on-change'): this;
1 -// Type definitions for iview 3.1.0 1 +// Type definitions for iview 3.3.0
2 // Project: https://github.com/iview/iview 2 // Project: https://github.com/iview/iview
3 // Definitions by: yangdan 3 // Definitions by: yangdan
4 // Definitions: https://github.com/yangdan8/iview.git 4 // Definitions: https://github.com/yangdan8/iview.git
1 -// Type definitions for iview 3.1.0 1 +// Type definitions for iview 3.3.0
2 // Project: https://github.com/iview/iview 2 // Project: https://github.com/iview/iview
3 // Definitions by: yangdan 3 // Definitions by: yangdan
4 // Definitions: https://github.com/yangdan8/iview.git 4 // Definitions: https://github.com/yangdan8/iview.git
1 -// Type definitions for iview 3.1.0 1 +// Type definitions for iview 3.3.0
2 // Project: https://github.com/iview/iview 2 // Project: https://github.com/iview/iview
3 // Definitions by: yangdan 3 // Definitions by: yangdan
4 // Definitions: https://github.com/yangdan8/iview.git 4 // Definitions: https://github.com/yangdan8/iview.git
1 -// Type definitions for iview 3.1.0 1 +// Type definitions for iview 3.3.0
2 // Project: https://github.com/iview/iview 2 // Project: https://github.com/iview/iview
3 // Definitions by: yangdan 3 // Definitions by: yangdan
4 // Definitions: https://github.com/yangdan8/iview.git 4 // Definitions: https://github.com/yangdan8/iview.git
1 -// Type definitions for iview 3.1.0 1 +// Type definitions for iview 3.3.0
2 // Project: https://github.com/iview/iview 2 // Project: https://github.com/iview/iview
3 // Definitions by: yangdan 3 // Definitions by: yangdan
4 // Definitions: https://github.com/yangdan8/iview.git 4 // Definitions: https://github.com/yangdan8/iview.git
1 -// Type definitions for iview 3.1.0 1 +// Type definitions for iview 3.3.0
2 // Project: https://github.com/iview/iview 2 // Project: https://github.com/iview/iview
3 // Definitions by: yangdan 3 // Definitions by: yangdan
4 // Definitions: https://github.com/yangdan8/iview.git 4 // Definitions: https://github.com/yangdan8/iview.git
1 -// Type definitions for iview 3.1.0 1 +// Type definitions for iview 3.3.0
2 // Project: https://github.com/iview/iview 2 // Project: https://github.com/iview/iview
3 // Definitions by: yangdan 3 // Definitions by: yangdan
4 // Definitions: https://github.com/yangdan8/iview.git 4 // Definitions: https://github.com/yangdan8/iview.git
@@ -76,6 +76,16 @@ export declare interface Table extends Vue { @@ -76,6 +76,16 @@ export declare interface Table extends Vue {
76 */ 76 */
77 "no-filtered-data-text"?: string; 77 "no-filtered-data-text"?: string;
78 /** 78 /**
  79 + * 是否开启拖拽调整行顺序,需配合 @on-drag-drop 事件使用
  80 + * @default false
  81 + */
  82 + "draggable"?: boolean;
  83 + /**
  84 + * 列使用 tooltip 时,配置它的主题,可选值为 dark 或 light
  85 + * @default dark
  86 + */
  87 + "tooltip-theme"?: string;
  88 + /**
79 * 开启 highlight-row 后有效,当表格的当前行发生变化的时候会触发 89 * 开启 highlight-row 后有效,当表格的当前行发生变化的时候会触发
80 * currentRow:当前高亮行的数据 90 * currentRow:当前高亮行的数据
81 * oldCurrentRow:上一次高亮的数据 91 * oldCurrentRow:上一次高亮的数据
@@ -155,6 +165,12 @@ export declare interface Table extends Vue { @@ -155,6 +165,12 @@ export declare interface Table extends Vue {
155 */ 165 */
156 $emit(eventName: "on-expand", row: object, status: string): this; 166 $emit(eventName: "on-expand", row: object, status: string): this;
157 /** 167 /**
  168 + * 拖拽排序松开时触发,返回置换的两行数据索引
  169 + * index1
  170 + * index2
  171 + */
  172 + $emit(eventName: "on-drag-drop", index1: number, index2: number): this;
  173 + /**
158 * 导出数据 174 * 导出数据
159 */ 175 */
160 exportCsv(params: TableExportCsvParams): void; 176 exportCsv(params: TableExportCsvParams): void;
1 -// Type definitions for iview 3.1.0 1 +// Type definitions for iview 3.3.0
2 // Project: https://github.com/iview/iview 2 // Project: https://github.com/iview/iview
3 // Definitions by: yangdan 3 // Definitions by: yangdan
4 // Definitions: https://github.com/yangdan8/iview.git 4 // Definitions: https://github.com/yangdan8/iview.git
@@ -40,6 +40,10 @@ export declare interface Tabs extends Vue { @@ -40,6 +40,10 @@ export declare interface Tabs extends Vue {
40 */ 40 */
41 'before-remove'?: (index: number) => {}; 41 'before-remove'?: (index: number) => {};
42 /** 42 /**
  43 + * 当嵌套使用tabs时,指定name区分层级
  44 + */
  45 + name?: string;
  46 + /**
43 * tab 被点击时触发 47 * tab 被点击时触发
44 */ 48 */
45 $emit(eventName: 'on-click', name: string): this; 49 $emit(eventName: 'on-click', name: string): this;
@@ -82,4 +86,12 @@ export declare interface TabPane extends Vue { @@ -82,4 +86,12 @@ export declare interface TabPane extends Vue {
82 * @default null 86 * @default null
83 */ 87 */
84 closable?: boolean; 88 closable?: boolean;
  89 + /**
  90 + * 当嵌套使用tabs时,设置该属性指向对应tabs的name字段
  91 + */
  92 + tab?: string;
  93 + /**
  94 + * 在tabpane使用v-if时,并不会按照预先的顺序渲染,这时可设置index,并从小到大排序(需大于0)
  95 + */
  96 + index?: number;
85 } 97 }
1 -// Type definitions for iview 3.1.0 1 +// Type definitions for iview 3.3.0
2 // Project: https://github.com/iview/iview 2 // Project: https://github.com/iview/iview
3 // Definitions by: yangdan 3 // Definitions by: yangdan
4 // Definitions: https://github.com/yangdan8/iview.git 4 // Definitions: https://github.com/yangdan8/iview.git
types/time-picker.d.ts
1 -// Type definitions for iview 3.1.0 1 +// Type definitions for iview 3.3.0
2 // Project: https://github.com/iview/iview 2 // Project: https://github.com/iview/iview
3 // Definitions by: yangdan 3 // Definitions by: yangdan
4 // Definitions: https://github.com/yangdan8/iview.git 4 // Definitions: https://github.com/yangdan8/iview.git
1 -// Type definitions for iview 3.1.0 1 +// Type definitions for iview 3.3.0
2 // Project: https://github.com/iview/iview 2 // Project: https://github.com/iview/iview
3 // Definitions by: yangdan 3 // Definitions by: yangdan
4 // Definitions: https://github.com/yangdan8/iview.git 4 // Definitions: https://github.com/yangdan8/iview.git
types/timeline.d.ts
1 -// Type definitions for iview 3.1.0 1 +// Type definitions for iview 3.3.0
2 // Project: https://github.com/iview/iview 2 // Project: https://github.com/iview/iview
3 // Definitions by: yangdan 3 // Definitions by: yangdan
4 // Definitions: https://github.com/yangdan8/iview.git 4 // Definitions: https://github.com/yangdan8/iview.git
types/tooltip.d.ts
1 -// Type definitions for iview 3.1.0 1 +// Type definitions for iview 3.3.0
2 // Project: https://github.com/iview/iview 2 // Project: https://github.com/iview/iview
3 // Definitions by: yangdan 3 // Definitions by: yangdan
4 // Definitions: https://github.com/yangdan8/iview.git 4 // Definitions: https://github.com/yangdan8/iview.git
types/transfer.d.ts
1 -// Type definitions for iview 3.1.0 1 +// Type definitions for iview 3.3.0
2 // Project: https://github.com/iview/iview 2 // Project: https://github.com/iview/iview
3 // Definitions by: yangdan 3 // Definitions by: yangdan
4 // Definitions: https://github.com/yangdan8/iview.git 4 // Definitions: https://github.com/yangdan8/iview.git
1 -// Type definitions for iview 3.1.0 1 +// Type definitions for iview 3.3.0
2 // Project: https://github.com/iview/iview 2 // Project: https://github.com/iview/iview
3 // Definitions by: yangdan 3 // Definitions by: yangdan
4 // Definitions: https://github.com/yangdan8/iview.git 4 // Definitions: https://github.com/yangdan8/iview.git
@@ -44,6 +44,11 @@ export declare interface Tree extends Vue { @@ -44,6 +44,11 @@ export declare interface Tree extends Vue {
44 */ 44 */
45 "check-strictly"?: boolean; 45 "check-strictly"?: boolean;
46 /** 46 /**
  47 + * 开启后,在 show-checkbox 模式下,select 的交互也将转为 check
  48 + * @default false
  49 + */
  50 + "check-directly"?: boolean;
  51 + /**
47 * 点击树节点时触发 52 * 点击树节点时触发
48 * @default 当前已勾选节点的数组、当前项 53 * @default 当前已勾选节点的数组、当前项
49 */ 54 */
1 -// Type definitions for iview 3.1.0 1 +// Type definitions for iview 3.3.0
2 // Project: https://github.com/iview/iview 2 // Project: https://github.com/iview/iview
3 // Definitions by: yangdan 3 // Definitions by: yangdan
4 // Definitions: https://github.com/yangdan8/iview.git 4 // Definitions: https://github.com/yangdan8/iview.git
@@ -25,6 +25,11 @@ export declare interface Upload extends Vue { @@ -25,6 +25,11 @@ export declare interface Upload extends Vue {
25 */ 25 */
26 paste?: boolean; 26 paste?: boolean;
27 /** 27 /**
  28 + * 是否禁用
  29 + * @default false
  30 + */
  31 + disabled?: boolean;
  32 + /**
28 * 上传时附带的额外参数 33 * 上传时附带的额外参数
29 */ 34 */
30 data?: object; 35 data?: object;