<template>
  <div>
    <p>横向单链型</p>
    <br /><br />
    <tiny-steps :data="data" :active="advancedActive" @click="advancedClick"></tiny-steps>

    <p style="margin-top: 50px">&nbsp;</p>

    <p>垂直单链型</p>
    <br /><br />
    <tiny-steps vertical :data="data" :visible-num="4" :active="advancedActive2" @click="advancedClick2"></tiny-steps>
  </div>
</template>

<script>
import { TinySteps, TinyModal } from '@opentiny/vue'

export default {
  components: {
    TinySteps
  },
  data() {
    return {
      advancedActive: 2,
      advancedActive2: 1,
      data: [
        {
          name: 'Basic Info',
          status: '',
          description:
            'Optional Optional Optional Optional Optional Optional Optional Optional Optional Optional Optional Optional Optional Optional Optional Optional Optional Optional Optional Optional Optional Optional Optional Optional '
        },
        { name: 'BOQ Info', status: 'done', description: 'done 已完成' },
        { name: 'BBQ Info', status: 'error', description: 'error 错误' },
        {
          name: 'Involved Parties Involved Parties Involved Parties',
          status: 'disabled',
          description:
            'disabled 已禁用，描述内容描述内容，超出部分隐藏，描述内容，超出部分隐藏，描述内容，超出部分隐藏，描述内容，超出部分隐藏'
        },
        { name: 'Billing', status: '', description: '默认无状态' }
      ]
    }
  },
  methods: {
    advancedClick(index, node) {
      this.advancedActive = index

      TinyModal.message(`节点index: ${index}; 节点信息: ${JSON.stringify(node)}.`)
    },
    advancedClick2(index, node) {
      this.advancedActive2 = index

      TinyModal.message(`节点index: ${index}; 节点信息: ${JSON.stringify(node)}.`)
    }
  }
}
</script>
