import { defineComponent } from 'vue';
import { NButton } from 'naive-ui';
import png404 from './404.png';
import styles from './index.module.less';
import { useRouter } from 'vue-router';

export default defineComponent({
  name: '404-page',
  setup() {
    const router = useRouter();
    return () => (
      <div class={styles['page-404']}>
        <img src={png404} />
        <p class={styles.tip}>页面找不到了</p>
        <NButton
          type="primary"
          ghost
          class={styles.backBtn}
          onClick={() => {
            // 返回首页
            router.replace('/');
          }}>
          返回
        </NButton>
      </div>
    );
  }
});
