tiny-vue/examples/docs/resources/pc/demo/steps/text-position.vue

59 lines
1.2 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>
<p>默认内容位于序号下方</p>
<tiny-time-line :data="data" :active="normalActive" type="normal" @click="normalClick">
</tiny-time-line>
<p>设置<code>textPosition</code><code>right</code> 内容位于序号右边</p>
<tiny-time-line :data="data" :active="normalActive1" type="normal" text-position="right" @click="normalClick1">
</tiny-time-line>
</template>
<script lang="jsx">
import {
TimeLine,
Modal
} from '@opentiny/vue'
export default {
components: {
TinyTimeLine: TimeLine
},
data() {
return {
normalActive: 0,
data: [{
name: 'Basic Info.'
}, {
name: 'AAAAA'
}, {
name: 'Involved Parties',
error: true
}, {
name: 'Billing',
disabled: true
}],
normalActive1: 0,
}
},
methods: {
normalClick(index, node) {
this.normalActive = index
Modal.message(`节点index: ${index}; 节点信息: ${JSON.stringify(node)}.`)
},
normalClick1(index, node) {
this.normalActive1 = index
Modal.message(`节点index: ${index}; 节点信息: ${JSON.stringify(node)}.`)
}
}
}
</script>
<style lang="less">
code {
padding: 4px;
background-color: var(--lightless);
}
</style>