vue.js背景图全屏_Vue.js插件,可让您在全屏画廊中显示图像

vue.js背景图全屏

v-img (v-img)

v-img is a plugin for Vue.js that allows you to show images in full-screen gallery by adding only one directive to the img tag.

v-img是Vue.js的插件,通过向img标签仅添加一个指令,您可以在全屏画廊中显示图像。

v-imgV

安装 (Installation)

npm (npm)
npm install v-img --save

入门 (Getting started)

In your script entry point:

在脚本入口点:

import Vue from 'vue';
import VueImg from 'v-img';

Vue.use(VueImg);

可选配置 (Optional configurations)

*in this snippet all settings has its default value. No need to specify them unless you want to change default behavior.

*在此代码段中,所有设置均为默认值。 除非您想更改默认行为,否则无需指定它们。

const vueImgConfig = {
  // Consider alt of image as its title in gallery?
  altAsTitle: false,
}
Vue.use(VueImg, vueImgConfig);

用法 (Usage)

Add v-img directive to the image.

v-img指令添加到映像。

<img v-img src="...">

可用选项 (Available options)

Add similar directive arguments to place images to one gallery. (:name from the example below could be anything you want)

添加类似的指令参数以将图像放置到一个图库中。 (以下示例中的:name可以是您想要的任何内容)

<img v-img:name src="...">
<img v-img:name src="...">

Options that could be specified in directive value

可以在指令值中指定的选项

<img v-img="{...}" src="...">

作者 (Author)

crowdbotics

翻译自: https://vuejsexamples.com/a-plugin-for-vue-js-that-allows-you-to-show-images-in-full-screen-gallery/

vue.js背景图全屏

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值