New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

cos-image

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cos-image

Tencent cloud image loading optimization control. ## DEMO ![loading](./asset/loading.gif "loading") ![loading2](./asset/loading2.gif "loading2") ## Installation

latest
Source
npmnpm
Version
0.1.4
Version published
Maintainers
1
Created
Source

<cos-image> image component.

Tencent cloud image loading optimization control.

DEMO

loading loading2

Installation

$ npm install cos-image

Usage

import { CosImage } from 'cos-image'

or

import CosImage from 'cos-image'
Vue.use(CosImage)
// simple
<cos-image  src="xxx.png"></cos-image>

// senior
<cos-image
      alt="load fail"
	  thumbnail="thumbnail.png"
	  :thumbnailClarity="1"
      error-image="error.png"
      src="source.png"
	  :clarity="70"
      ></cos-image>

Optional props

  • cos-image[thumbnail] Thumbnail, the default thumbnail of the original image.
  • cos-image[thumbnailClarity] The definition of thumbnail is 1-100, and the default is 1.
  • cos-image[src] Picture display address.
  • cos-image[clarity] The definition of the original image is 1-100, and the default is 100.
  • cos-image[type] Thumbnail or loading. The default is thumbnail.
  • cos-image[loading] Loading before the end of the loading of the original image, which is self-contained by default.
  • cos-image[errorImage] Failed bitmap, empty by default.

Attributes

Supports attributes and events for all native img elements.

Events

  • error – Image loading failure event.
  • load – Image loading success event.
<cos-image
	 @load="successEvent"
	 @error="failEvent"
      src="source.png"
      ></cos-image>

Browser support

  • Chrome
  • Firefox
  • Safari
  • Microsoft Edge

Development

npm install
npm run serve

License

Distributed under the MIT license. See LICENSE for details.

Keywords

cos

FAQs

Package last updated on 14 Oct 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts