ant-design-vue/components/tooltip/demo/basic.vue
2017-11-03 18:06:00 +08:00

67 lines
1.4 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<template>
<div>
<tool-tip
placement="bottom"
:title="showText">
<h1 @click="boom" style="display: inline-block">This is just a test, put your cursor here</h1>
</tool-tip>
<ant-button>2223</ant-button>
<div class="box">
<table>
<tr v-for="(tr, index) in table" :key="index">
<td v-for="(td, i) in tr" :key="i">
<tool-tip v-if="td" :placement="td" :title="td"><AntButton type="primary">{{td}}</AntButton></tool-tip>
</td>
</tr>
</table>
</div>
</div>
</template>
<script>
import { ToolTip, Button } from '../../../components'
import '../../../components/button/style'
export default {
name: 'tooltip-basic',
data() {
return {
show: true,
showText: '你好啊233',
table: [
['', 'topLeft', 'top', 'topRight', ''],
['leftTop', '', '', '', 'rightTop'],
['left', '', '', '', 'right'],
['leftBottom', '', '', '', 'rightBottom'],
['', 'bottomLeft', 'bottom', 'bottomRight', ''],
]
}
},
methods: {
boom() {
this.showText += '3'
}
},
components: {
ToolTip,
AntButton: Button,
},
beforeUpdate() {
console.info(90909090)
}
}
</script>
<style scoped lang="less">
.box {
margin: 100px;
}
table {
td {
padding: 20px;
}
p {
text-align: center;
vertical-align: middle;
}
}
</style>