0.2.3 • Published 3 years ago

vue-larger-image v0.2.3

Weekly downloads
-
License
MIT
Repository
-
Last release
3 years ago

vue-larger-image

English | 中文简体

A plugin based on Vuejs, which provides the function of viewing larger image. As view sounds like Vue, so we call it vue-larger-iamge

iamge image

Usage

Option one:

# with npm
npm i vue-larger-image

# with yarn
yarn add vue-larger-iamge

Register in main.js

import VueLargerImage from 'vue-larger-image'
Vue.use(VueLargerImage)

In the component you wish to deploy

<vue-larger-image
  width="200"
  bgColor="rgb(0,0,0,.2)"
  height="auto"
  alt="hello"
  src="https://static.tomluvjerry.cn/files/lhyUnited/2236da75b7fba3b3ff6380242166e9b3.jpg">
</vue-larger-image>

Option two:

import the plugin as Web-component

<script src="https://cdn.jsdelivr.net/npm/vue-larger-image@latest/dist/wc/vue-larger-image.min.js"></script>

Some place where you wish to deploy:

<vue-larger-image
  width="200"
  bgColor="rgb(0,0,0,.2)"
  height="auto"
  alt="hello"
  src="https://static.tomluvjerry.cn/files/lhyUnited/2236da75b7fba3b3ff6380242166e9b3.jpg">
</vue-larger-image>

More about Web-component,please check: https://cli.vuejs.org/zh/guide/build-targets.html#web-components-%E7%BB%84%E4%BB%B6

Props

optionstypedefaultadditional
srcStringhttps://i.loli.net/2021/03/29/Hcvo57YUtpGmwdq.jpgDO NOT USE RELATIVE PATH
widthStringautowidth of image
heightStringautoheight of image
bgColorStringrgba(0,0,0,.45)the background-color of mask
altStringimagesomething to show when the image crushed
titleString''
srcsetString''

Develop

Clone this repo

git clone git@github.com:lhyUnited/vue-larger-image.git

Start the server

yarn serve

Build

"scripts": {
  "serve": "vue-cli-service serve",
  "lint": "vue-cli-service lint",
  "wc": "rm -rf ./dist/wc/* && vue-cli-service build --target wc --name vue-larger-image --dest dist/wc VueLargerImage/src/index.vue",
  "lib": "rm -rf ./dist/lib/* && vue-cli-service build --target lib --name vue-larger-image --dest dist/lib ./VueLargerImage/index.js",
  "build": "rm -rf ./dist/* && npm run wc && npm run lib",
  "pp": "npm run wc && npm run lib && npm publish --registry http://registry.npmjs.org"
},
/** 
* wc: output expected as Web-component
* lib: output expected as umd
* pp: prepublish
*/

LICENSE

MIT

0.2.3

3 years ago

0.2.2

3 years ago

0.2.1

3 years ago

0.2.0

3 years ago

0.1.8

3 years ago

0.1.7

3 years ago

0.1.9

3 years ago

0.1.6

3 years ago

0.1.5

3 years ago

0.1.3

3 years ago

0.1.2

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago