2.0.0 • Published 1 year ago

vue-brush v2.0.0

Weekly downloads
6
License
MIT
Repository
github
Last release
1 year ago

vue-brush

Version Downloads Issues License

Gracefully load images, integrated with Vue.js.

Live demo

Features

  • Only 5.3KB minified while 2.3KB gzipped
  • Integrated with Vue.js as a plugin
  • Loading indicator and error indicator
  • Able to specified aspect ratio of container
  • Able to crop image overflowed
  • Able to customize indicator styles

Usage

Register the plugin first.

import Vue from 'vue'
import vueBrush from 'vue-brush'

Vue.use(vueBrush)

new Vue()

Then, use it anywhere.

<template>
  <div id="app">
    <brush source="https://example.com/image.jpg" :ratio="1280 / 720" />
    <brush source="https://example.com/avatar.jpg" cropped />
  </div>
</template>

Options

<brush>

PropertyTypeRequiredDescriptionDefault
sourceStringNThe URL of image.null
ratioNumberNThe ratio of image width to height.1
croppedBooleanNWhether to crop image overflowed.false

License

MIT

2.0.0

1 year ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago