Giter Site home page Giter Site logo

Comments (4)

mmorainville avatar mmorainville commented on August 16, 2024

Hi @jvenema,

It's an interesting idea indeed. A PR would be welcome! :)

from vue-tour.

sheehan avatar sheehan commented on August 16, 2024

I was able to achieve this with the following step config:

{
  target: 'body',
  content: 'This is a centered pop-up.',
  params: {
    placement: 'none',
    modifiers: {
      computeStyle: {
        enabled: true,
        fn(data) {
          data.styles = Object.assign({}, data.styles, {
            left: '50%',
            top: '50%',
            transform: 'translate(-50%, -50%)'
          });

          return data;
        }
      }
    }
  }
}

(via floating-ui/floating-ui#642 (comment))

from vue-tour.

mattgreenfield avatar mattgreenfield commented on August 16, 2024

I was after this too and used @sheehan's solution to target 'body' but it does feel like a hack.

I would imagine this being an alternative to providing a target option and I can see a need to position it in different places around the screen.

{
  target: false,
  content: 'This is a centered pop-up.',
  params: {
    placement: 'center', // or 'bottom', 'bottom-left', 'top' etc etc
  },
}

I see there's a PR for similar functionality here https://github.com/pulsardev/vue-tour/pull/51/files

from vue-tour.

mmorainville avatar mmorainville commented on August 16, 2024

PR has been merged: https://github.com/pulsardev/vue-tour/pull/51/files.
But as of now the feature stay limited to the step being placed in the viewport's center.
We'll see to improve that for the Vue 3 version of vue-tour but the Vue 2 version will likely stay like this (you can always manually tweak the CSS on v-step--sticky to place it wherever you want though).

from vue-tour.

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.