Giter VIP home page Giter VIP logo

Comments (1)

pepedd864 avatar pepedd864 commented on May 28, 2024
  • I have searched the issues of this repository and believe that this is not a duplicate.

Version

4.0.5

Environment

Windows 11, Edge 121, Vue 3.3

主要代码

<template>
  <div>
    <a-tour
      v-model:current="current"
      :steps="steps"
      :open="open"
      @close="open = false"
    />
    <a-button @click="open = !open">按钮</a-button>
    <div class="container">
      <div class="left">
        <div class="card">test</div>
      </div>
      <div class="right">
        <a href="#">返回首页</a>
        <div class="card">test</div>
      </div>
    </div>
  </div>
</template>
<script setup>
import { ref } from "vue";
const current = ref(0);
const open = ref(false);
const steps = ref([
  {
    title: "第一步",
    target: () => document.querySelector(".left .card"),
  },
  {
    title: "第二步",
    target: () => document.querySelector(".right .card"),
  },
]);
</script>

<style>
/* 如果使用了 smooth tour的指向将不准确 */
html,
body {
  scroll-behavior: smooth;
}

.container {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  margin: 0 auto;
  width: 80%;
  height: 100%;

  .left {
    position: relative;
    top: 0;
    width: 200px;
    height: 100vh;
    border: 1px red solid;
  }

  .right {
    position: relative;
    top: 100vh;
    width: 200px;
    height: 100vh;
    border: 1px blue solid;
  }
}
</style>

Reproduction link

Edit on CodeSandbox

Steps to reproduce

使用页面使用smooth属性会出现异常指向

What is expected?

正确的指向 gif gif

What is actually happening?

错误的指向

@tangjinzhou @wangxueliang

from ant-design-vue.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.