GithubHelp home page GithubHelp logo

iwyvi / vue-float-preview Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 500 KB

A Floating Previewer for Vue.js.

Home Page: https://www.iwyvi.com/vue-float-preview/

License: MIT License

Vue 82.42% TypeScript 14.09% JavaScript 3.49%
vue components typescript vue-components

vue-float-preview's Introduction

vue-float-preview

This component ONLY supports mouse operations!

A Floating Previewer for Vue.js.

https://www.iwyvi.com/vue-float-preview/

Install

yarn

yarn add vue-float-preview

npm

npm install --save vue-float-preview

Quick Start

import Vue from 'vue';
import VueFloatPreview from 'vue-float-preview';

Vue.use(VueFloatPreview, OPTIONS);
<template>
  <float-preview src="IMAGE_SRC"></float-preview>
</template>

For more information, please refer to Examples.

Document

Attributes

Attribute Description Type Accepted Values Default
src src of the image string - -
thumbSrc src of the thumbnail string - -
disabled whether functions of the component is disabled boolean - false
scale whether scale of image when hovering is enabled boolean - true
thumbSize whether thumbnail fill the block contain / auto contain
show-delay the delay before showing the previewer number - 150
hide-delay the delay before hiding the previewer number - 100
offset-x the X-axis offset of the previewer (should always be positive) number - 40
offset-y the Y-axis offset of the previewer number - -40
content-style CSS style of content object - -
max-width maximum width of the previewer number - -
max-height maximum height of the previewer number - -
width width of the previewer number - -
height height of the previewer number - -
icon-theme theme of icons string light / dark light

Slots

Name Description Optional
default base content (will replace default image block) Y
preview content in previewer (will replace default image block in previewer) Y

Events

Event Name Description Parameters
onPreviewShow triggers when previewer shows -
onPreviewHide triggers when previewer hides -

Global Options

Vue.use(VueFloatPreview, {
  showDelay: 300,
  iconTheme: 'dark'
})

Available options: scale, thumbSize, showDelay, hideDelay, offsetX, offsetY, contentStyle, maxWidth, maxHeight, width, height, iconTheme.

Refers to the document of Attributes.

Development

Setup

Please use yarn to install dependencies.

git clone [email protected]:IwYvI/vue-float-preview.git

# install dependencies
yarn

Build

yarn dist

Start development server

yarn dev

LICENSE

MIT

vue-float-preview's People

Contributors

dependabot[bot] avatar iwyvi avatar

Stargazers

 avatar

Watchers

 avatar  avatar

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.