Commit fc640135d697aa9b890a03dc6dd6d23788a826ca

Authored by 梁灏
1 parent e9dd4dab

Tabs add on-visible-change event

Tabs add on-visible-change event
package.json
1 1 {
2 2 "name": "iview",
3   - "version": "0.9.11-rc-1",
  3 + "version": "0.9.11-rc-2",
4 4 "title": "iView",
5 5 "description": "A high quality UI components Library with Vue.js",
6 6 "homepage": "http://www.iviewui.com",
... ...
src/components/dropdown/dropdown.vue
... ... @@ -91,6 +91,7 @@
91 91 } else {
92 92 this.$refs.drop.destroy();
93 93 }
  94 + this.$emit('on-visible-change', val);
94 95 }
95 96 },
96 97 events: {
... ...
test/routers/dropdown.vue
1 1 <template>
2   - <Dropdown>
  2 + <Dropdown @on-visible-change="v">
3 3 <a href="javascript:void(0)">
4 4 下拉菜单
5 5 <Icon type="arrow-down-b"></Icon>
... ... @@ -10,16 +10,6 @@
10 10 <Dropdown-item disabled>豆汁儿</Dropdown-item>
11 11 <Dropdown-item>冰糖葫芦</Dropdown-item>
12 12 <Dropdown-item divided>北京烤鸭</Dropdown-item>
13   - <Dropdown-item>驴打滚</Dropdown-item>
14   - <Dropdown-item>炸酱面</Dropdown-item>
15   - <Dropdown-item disabled>豆汁儿</Dropdown-item>
16   - <Dropdown-item>冰糖葫芦</Dropdown-item>
17   - <Dropdown-item divided>北京烤鸭</Dropdown-item>
18   - <Dropdown-item>驴打滚</Dropdown-item>
19   - <Dropdown-item>炸酱面</Dropdown-item>
20   - <Dropdown-item disabled>豆汁儿</Dropdown-item>
21   - <Dropdown-item>冰糖葫芦</Dropdown-item>
22   - <Dropdown-item divided>北京烤鸭</Dropdown-item>
23 13 </Dropdown-menu>
24 14 </Dropdown>
25 15 <Dropdown style="margin-left: 20px">
... ... @@ -38,6 +28,10 @@
38 28 </template>
39 29 <script>
40 30 export default {
41   -
  31 + methods: {
  32 + v (data) {
  33 + console.log(data)
  34 + }
  35 + }
42 36 }
43 37 </script>
... ...