ant-design-vue/components/tabs/demo/icon.vue

26 lines
544 B
Vue
Raw Normal View History

2017-12-01 04:21:43 +00:00
<template>
<Tabs defaultActiveKey="2">
<TabPane :tab="(h, tabKey) => renderTab(h, tabKey, 'apple')" tabKey="1">
Tab 1
</TabPane>
<TabPane :tab="(h, tabKey) => renderTab(h, tabKey, 'android')" tabKey="2">
Tab 2
</TabPane>
</Tabs>
</template>
<script>
import { Tabs, Icon } from 'antd'
export default {
methods: {
renderTab (h, tabKey, iconType) {
return h('span', [<Icon type={iconType} />, `Tab ${tabKey}`])
},
},
components: {
Tabs,
TabPane: Tabs.TabPane,
Icon,
},
}
</script>