Commit 644c37b3b358e975d15a157d0be3a1b5cf5c92cf
1 parent
a9131058
update License
不想为这些事发生争执,我只想做开源
Showing
6 changed files
with
168 additions
and
42 deletions
Show diff stats
CHANGE.md
| ... | ... | @@ -55,4 +55,6 @@ visible 改为 value,使用 v-model,style 改为 styles,$Modal çš„å…³é—æœ |
| 55 | 55 | i-table 改为 Table |
| 56 | 56 | ### Message |
| 57 | 57 | notice.vue 的 key 改为了 name,style 改为 styles |
| 58 | -notification.vue 的 key 改为了 name,style 改为 styles | |
| 59 | 58 | \ No newline at end of file |
| 59 | +notification.vue 的 key 改为了 name,style 改为 styles | |
| 60 | +## Popper | |
| 61 | +移除了 visible,使用 value å—æŽ§ï¼Œå¯èƒ½æ¶‰åŠåˆ°çš„组件:Poptipã€Tooltip | |
| 60 | 62 | \ No newline at end of file | ... | ... |
LICENSE
| 1 | 1 | The MIT License (MIT) |
| 2 | 2 | |
| 3 | -Copyright (c) 2016 iview | |
| 3 | +Copyright (c) 2016 iView | |
| 4 | 4 | |
| 5 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy |
| 6 | 6 | of this software and associated documentation files (the "Software"), to deal |
| ... | ... | @@ -19,3 +19,25 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 19 | 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 20 | 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
| 21 | 21 | SOFTWARE. |
| 22 | + | |
| 23 | +The MIT License (MIT) | |
| 24 | + | |
| 25 | +Copyright (c) 2016 ElemeFE | |
| 26 | + | |
| 27 | +Permission is hereby granted, free of charge, to any person obtaining a copy | |
| 28 | +of this software and associated documentation files (the "Software"), to deal | |
| 29 | +in the Software without restriction, including without limitation the rights | |
| 30 | +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| 31 | +copies of the Software, and to permit persons to whom the Software is | |
| 32 | +furnished to do so, subject to the following conditions: | |
| 33 | + | |
| 34 | +The above copyright notice and this permission notice shall be included in all | |
| 35 | +copies or substantial portions of the Software. | |
| 36 | + | |
| 37 | +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
| 38 | +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
| 39 | +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |
| 40 | +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |
| 41 | +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | |
| 42 | +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | |
| 43 | +SOFTWARE. | |
| 22 | 44 | \ No newline at end of file | ... | ... |
README.md
| ... | ... | @@ -82,3 +82,11 @@ Normal browsers and Internet Explorer 9+. |
| 82 | 82 | - [Webpack](https://github.com/webpack/webpack) |
| 83 | 83 | - [ionicons](https://github.com/driftyco/ionicons) |
| 84 | 84 | - [Ant Design](https://github.com/ant-design/ant-design) |
| 85 | + | |
| 86 | +## Related open source projects | |
| 87 | +In iView, Some of the components and style codes refer to the following projects: | |
| 88 | +- [AntDesign](https://github.com/ant-design/ant-design) | |
| 89 | +- [Element](https://github.com/ElemeFE/element) | |
| 90 | +- [vue-antd](https://github.com/okoala/vue-antd) | |
| 91 | +- [vue-beauty](https://github.com/FE-Driver/vue-beauty) | |
| 92 | +- [Vux](https://github.com/airyland/vux) | |
| 85 | 93 | \ No newline at end of file | ... | ... |
examples/routers/select.vue
| ... | ... | @@ -210,7 +210,7 @@ |
| 210 | 210 | </i-col> |
| 211 | 211 | <i-col span="12"> |
| 212 | 212 | <Select v-model="model12" filterable multiple> |
| 213 | - <i-option v-for="item in cityList" :value="item.value">{{ item.label }}</i-option> | |
| 213 | + <i-option v-for="item in cityList" :key="item" :value="item.value">{{ item.label }}</i-option> | |
| 214 | 214 | </Select> |
| 215 | 215 | </i-col> |
| 216 | 216 | </Row> | ... | ... |
examples/routers/table.vue
| 1 | +<!--<template>--> | |
| 2 | + <!--<Card>--> | |
| 3 | + <!--<Table border :content="self" :columns="columns7" :data="data6"></Table>--> | |
| 4 | + <!--</Card>--> | |
| 5 | +<!--</template>--> | |
| 6 | +<!--<script>--> | |
| 7 | + <!--export default {--> | |
| 8 | + <!--data () {--> | |
| 9 | + <!--return {--> | |
| 10 | + <!--self: this,--> | |
| 11 | + <!--columns7: [--> | |
| 12 | + <!--{--> | |
| 13 | + <!--title: '姓名',--> | |
| 14 | + <!--key: 'name',--> | |
| 15 | + <!--render (row, column, index) {--> | |
| 16 | + <!--return `<Icon type="person"></Icon> <strong>${row.name}</strong>`;--> | |
| 17 | + <!--}--> | |
| 18 | + <!--},--> | |
| 19 | + <!--{--> | |
| 20 | + <!--title: '年龄',--> | |
| 21 | + <!--key: 'age'--> | |
| 22 | + <!--},--> | |
| 23 | + <!--{--> | |
| 24 | + <!--title: '地址',--> | |
| 25 | + <!--key: 'address'--> | |
| 26 | + <!--},--> | |
| 27 | + <!--{--> | |
| 28 | + <!--title: '操作',--> | |
| 29 | + <!--key: 'action',--> | |
| 30 | + <!--width: 150,--> | |
| 31 | + <!--align: 'center',--> | |
| 32 | + <!--render (row, column, index) {--> | |
| 33 | + <!--return `<i-button type="primary" size="small" @click.native="show(${index})">查看</i-button> <i-button type="error" size="small" @click.native="remove(${index})">删除</i-button>`;--> | |
| 34 | + <!--}--> | |
| 35 | + <!--}--> | |
| 36 | + <!--],--> | |
| 37 | + <!--data6: [--> | |
| 38 | + <!--{--> | |
| 39 | + <!--name: '王小明',--> | |
| 40 | + <!--age: 18,--> | |
| 41 | + <!--address: '北京市朝阳区芍药居'--> | |
| 42 | + <!--},--> | |
| 43 | + <!--{--> | |
| 44 | + <!--name: '张小刚',--> | |
| 45 | + <!--age: 25,--> | |
| 46 | + <!--address: '北京市海淀区西二旗'--> | |
| 47 | + <!--},--> | |
| 48 | + <!--{--> | |
| 49 | + <!--name: '李小红',--> | |
| 50 | + <!--age: 30,--> | |
| 51 | + <!--address: '上海市浦东新区世纪大道'--> | |
| 52 | + <!--},--> | |
| 53 | + <!--{--> | |
| 54 | + <!--name: '周小伟',--> | |
| 55 | + <!--age: 26,--> | |
| 56 | + <!--address: '深圳市南山区深南大道'--> | |
| 57 | + <!--}--> | |
| 58 | + <!--]--> | |
| 59 | + <!--}--> | |
| 60 | + <!--},--> | |
| 61 | + <!--methods: {--> | |
| 62 | + <!--show (index) {--> | |
| 63 | + <!--console.log(`姓名:${this.data6[index].name}<br>年龄:${this.data6[index].age}<br>地址:${this.data6[index].address}`)--> | |
| 64 | + <!--},--> | |
| 65 | + <!--remove (index) {--> | |
| 66 | + <!--this.data6.splice(index, 1);--> | |
| 67 | + <!--}--> | |
| 68 | + <!--},--> | |
| 69 | + <!--mounted () {--> | |
| 70 | + <!--setTimeout(() => {--> | |
| 71 | +<!--// this.data6.splice(2, 1);--> | |
| 72 | + <!--}, 3000)--> | |
| 73 | + <!--}--> | |
| 74 | + <!--}--> | |
| 75 | +<!--</script>--> | |
| 76 | + | |
| 77 | + | |
| 1 | 78 | <template> |
| 2 | - <Card> | |
| 3 | - <Table border :content="self" :columns="columns7" :data="data6"></Table> | |
| 4 | - </Card> | |
| 79 | + <div> | |
| 80 | + <i-table border :columns="columns6" :data="data5"></i-table> | |
| 81 | + </div> | |
| 5 | 82 | </template> |
| 6 | 83 | <script> |
| 7 | 84 | export default { |
| 8 | 85 | data () { |
| 9 | 86 | return { |
| 10 | - self: this, | |
| 11 | - columns7: [ | |
| 87 | + columns6: [ | |
| 88 | + { | |
| 89 | + title: '日期', | |
| 90 | + key: 'date' | |
| 91 | + }, | |
| 12 | 92 | { |
| 13 | 93 | title: '姓名', |
| 14 | - key: 'name', | |
| 15 | - render (row, column, index) { | |
| 16 | - return `<Icon type="person"></Icon> <strong>${row.name}</strong>`; | |
| 17 | - } | |
| 94 | + key: 'name' | |
| 18 | 95 | }, |
| 19 | 96 | { |
| 20 | 97 | title: '年龄', |
| 21 | - key: 'age' | |
| 98 | + key: 'age', | |
| 99 | + filters: [ | |
| 100 | + { | |
| 101 | + label: '大于25岁', | |
| 102 | + value: 1 | |
| 103 | + }, | |
| 104 | + { | |
| 105 | + label: '小于25岁', | |
| 106 | + value: 2 | |
| 107 | + } | |
| 108 | + ], | |
| 109 | + filterMultiple: false, | |
| 110 | + filterMethod (value, row) { | |
| 111 | + if (value === 1) { | |
| 112 | + return row.age > 25; | |
| 113 | + } else if (value === 2) { | |
| 114 | + return row.age < 25; | |
| 115 | + } | |
| 116 | + } | |
| 22 | 117 | }, |
| 23 | 118 | { |
| 24 | 119 | title: '地址', |
| 25 | - key: 'address' | |
| 26 | - }, | |
| 27 | - { | |
| 28 | - title: '操作', | |
| 29 | - key: 'action', | |
| 30 | - width: 150, | |
| 31 | - align: 'center', | |
| 32 | - render (row, column, index) { | |
| 33 | - return `<i-button type="primary" size="small" @click.native="show(${index})">查看</i-button> <i-button type="error" size="small" @click.native="remove(${index})">删除</i-button>`; | |
| 120 | + key: 'address', | |
| 121 | + filters: [ | |
| 122 | + { | |
| 123 | + label: '北京', | |
| 124 | + value: '北京' | |
| 125 | + }, | |
| 126 | + { | |
| 127 | + label: '上海', | |
| 128 | + value: '上海' | |
| 129 | + }, | |
| 130 | + { | |
| 131 | + label: '深圳', | |
| 132 | + value: '深圳' | |
| 133 | + } | |
| 134 | + ], | |
| 135 | + filterMethod (value, row) { | |
| 136 | + return row.address.indexOf(value) > -1; | |
| 34 | 137 | } |
| 35 | 138 | } |
| 36 | 139 | ], |
| 37 | - data6: [ | |
| 140 | + data5: [ | |
| 38 | 141 | { |
| 39 | 142 | name: '王小明', |
| 40 | 143 | age: 18, |
| 41 | - address: '北京市朝阳区芍药居' | |
| 144 | + address: '北京市朝阳区芍药居', | |
| 145 | + date: '2016-10-03' | |
| 42 | 146 | }, |
| 43 | 147 | { |
| 44 | 148 | name: '张小刚', |
| 45 | 149 | age: 25, |
| 46 | - address: '北京市海淀区西二旗' | |
| 150 | + address: '北京市海淀区西二旗', | |
| 151 | + date: '2016-10-01' | |
| 47 | 152 | }, |
| 48 | 153 | { |
| 49 | 154 | name: '李小红', |
| 50 | 155 | age: 30, |
| 51 | - address: '上海市浦东新区世纪大道' | |
| 156 | + address: '上海市浦东新区世纪大道', | |
| 157 | + date: '2016-10-02' | |
| 52 | 158 | }, |
| 53 | 159 | { |
| 54 | 160 | name: '周小伟', |
| 55 | 161 | age: 26, |
| 56 | - address: '深圳市南山区深南大道' | |
| 162 | + address: '深圳市南山区深南大道', | |
| 163 | + date: '2016-10-04' | |
| 57 | 164 | } |
| 58 | 165 | ] |
| 59 | 166 | } |
| 60 | - }, | |
| 61 | - methods: { | |
| 62 | - show (index) { | |
| 63 | - console.log(`姓名:${this.data6[index].name}<br>年龄:${this.data6[index].age}<br>地址:${this.data6[index].address}`) | |
| 64 | - }, | |
| 65 | - remove (index) { | |
| 66 | - this.data6.splice(index, 1); | |
| 67 | - } | |
| 68 | - }, | |
| 69 | - mounted () { | |
| 70 | - setTimeout(() => { | |
| 71 | -// this.data6.splice(2, 1); | |
| 72 | - }, 3000) | |
| 73 | 167 | } |
| 74 | 168 | } |
| 75 | 169 | </script> | ... | ... |
src/components/table/table-head.vue
| ... | ... | @@ -16,7 +16,7 @@ |
| 16 | 16 | </span> |
| 17 | 17 | <Poptip |
| 18 | 18 | v-if="isPopperShow(column)" |
| 19 | - :visible="column._filterVisible" | |
| 19 | + v-model="column._filterVisible" | |
| 20 | 20 | placement="bottom" |
| 21 | 21 | @on-popper-hide="handleFilterHide(index)"> |
| 22 | 22 | <span :class="[prefixCls + '-filter']"> |
| ... | ... | @@ -25,7 +25,7 @@ |
| 25 | 25 | <div slot="content" :class="[prefixCls + '-filter-list']" v-if="column._filterMultiple"> |
| 26 | 26 | <div :class="[prefixCls + '-filter-list-item']"> |
| 27 | 27 | <checkbox-group v-model="column._filterChecked"> |
| 28 | - <checkbox v-for="item in column.filters" :value="item.value">{{ item.label }}</checkbox> | |
| 28 | + <checkbox v-for="item in column.filters" :key="item" :label="item.value">{{ item.label }}</checkbox> | |
| 29 | 29 | </checkbox-group> |
| 30 | 30 | </div> |
| 31 | 31 | <div :class="[prefixCls + '-filter-footer']"> | ... | ... |