<template>
  <div class="editor">
    <Button type="primary" @click="handleClick('/editor/edit')">编辑</Button>
    <Button type="primary" @click="handleClick('/editor/view')">阅读</Button>
  </div>
</template>

<script lang="ts">
import { defineComponent } from 'vue';
import { Button } from 'ant-design-vue';
import { useRouter } from 'vue-router'

export default defineComponent({
  name: 'editor',
  components: { Button },
  setup() {
    const router = useRouter();

    const handleClick = (url: string) => {
      router.push(url);
    };

    return { handleClick };
  }
});
</script>
<style lang="less" scoped>
  .editor {
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    .ant-btn {
      margin: 0 10px;
    }
  }
</style>
