<template>
    <div class="ht-base-tree-folder-demo">
        <ht-base-tree :data="data" :render="renderContent"></ht-base-tree>
    </div>
</template>

<script>
  export default {
    name: 'HtBaseTreeFolderDemo',
      data () {
          return {
              data: [
                  {
                      title: '第一小节',
                      expand: true,
                      render: (h, { root, node, data }) => {
                          return h('span', {
                              style: {
                                  display: 'inline-block',
                                  width: '100%'
                              }
                          }, [
                              h('span', [
                                  h('ht-base-icon', {
                                      props: {
                                          type: 'LiRa_expand1'
                                      },
                                      style: {
                                          marginRight: '8px'
                                      }
                                  }),
                                  h('span', data.title)
                              ])
                          ]);
                      },
                      children: [
                          {
                              title: '第一小节1-0',
                              expand: true,
                              children: [
                                  {
                                      title: '小节内容-01',
                                      expand: true
                                  },
                                  {
                                      title: '小节内容-02',
                                      expand: true
                                  }
                              ]
                          },
                          {
                              title: '第一小节1-1',
                              expand: true,
                              children: [
                                  {
                                      title: '小节内容-01',
                                      expand: true
                                  },
                                  {
                                      title: '小节内容-02',
                                      expand: true
                                  }
                              ]
                          }
                      ]
                  }
              ]
          }
      },
      methods: {
          renderContent (h, { root, node, data }) {
              return h('span', {
                  style: {
                      display: 'inline-block',
                      width: '100%'
                  }
              }, [
                  h('span', [
                      h('ht-base-icon', {
                          props: {
                              type: 'LiRa_work'
                          },
                          style: {
                              marginRight: '8px'
                          }
                      }),
                      h('span', data.title)
                  ])
              ]);
          }
      }
  }
</script>
<style>
    .ht-base-tree-folder-demo {

    }
</style>

