<template>
  <div class="content">
    <Operates v-show="url != '/login' && url != '/writing/edit'" />
    <RouterView />
  </div>
</template>

<script setup lang="ts">
import { watch, ref } from "vue";
import { useRouter } from "vue-router";
import Operates from "@/components/Operates.vue";
const route = useRouter();
const url = ref("");
watch(
    () => route.currentRoute.value, // 监听路由的 fullPath 属性
    (newVal, oldVal) => {
      url.value = newVal.path;
    },
    { immediate: true } // 设置 immediate: true 以在组件挂载时立即触发一次
);
</script>
<style lang="scss" scoped>
.content {
  width: 100vw;
  height: 100vh;
  background-color: #edf2ffcc;
  position: relative;
  display: flex;

  &::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url("./assets/images/chat/chatLogo.svg");
    background-size: 45%;
    background-position: right bottom;
    background-repeat: no-repeat;
    opacity: 0.04;
    pointer-events: none;
    z-index: 0;
  }
  .chatLogo {
    width: 764px;
    height: 700px;
    position: absolute;
    right: 0px;
    bottom: 0px;
    z-index: 0;
  }
}
</style>