Gathering detailed insights and metrics for filerobot-image-editor-vue3
Gathering detailed insights and metrics for filerobot-image-editor-vue3
This is the implementation of Filerobot Image Editor using Ts & Vue 3 with a demo example.
npm install filerobot-image-editor-vue3
Typescript
Module System
Node Version
NPM Version
59.3
Supply Chain
91
Quality
82.9
Maintenance
100
Vulnerability
98.9
License
CSS (53.69%)
TypeScript (38.8%)
Vue (5.33%)
JavaScript (1.53%)
HTML (0.65%)
Total Downloads
484
Last Day
2
Last Week
10
Last Month
61
Last Year
484
9 Commits
1 Watching
1 Branches
1 Contributors
Minified
Minified + Gzipped
Latest Version
1.0.5
Package Id
filerobot-image-editor-vue3@1.0.5
Unpacked Size
2.71 MB
Size
780.14 kB
File Count
11
NPM Version
10.8.2
Node Version
20.18.1
Publised On
03 Dec 2024
Cumulative downloads
Total Downloads
Last day
-50%
2
Compared to previous day
Last week
-60%
10
Compared to previous week
Last month
-74.5%
61
Compared to previous month
Last year
0%
484
Compared to previous year
4
23
This is a Vue 3 wrapper component for the Filerobot Image Editor, a powerful and user-friendly image editor library. It provides an easy way to integrate advanced image editing features into your Vue 3 applications, enabling users to edit, crop, resize, annotate, and enhance images directly in the browser.
VSCode + Volar (and disable Vetur).
.vue
Imports in TSTypeScript cannot handle type information for .vue
imports by default, so we replace the tsc
CLI with vue-tsc
for type checking. In editors, we need Volar to make the TypeScript language service aware of .vue
types.
See Vite Configuration Reference.
1npm install
1npm run dev
1npm run build
1npm run test:unit
1npm run test:e2e:dev
This runs the end-to-end tests against the Vite development server. It is much faster than the production build.
But it's still recommended to test the production build with test:e2e
before deploying (e.g. in CI environments):
1npm run build 2npm run test:e2e
1npm run lint
Once installed, you can use the image editor component in your Vue application by passing a config
object with various configuration options.
1<script lang="ts"> 2import { FilerobotImageEditorVue3 } from 'filerobot-image-editor-vue3'; 3import type { IFilerobotImageEditorConfig, TOOLS, TABS } from 'filerobot-image-editor-vue3'; 4 5export default { 6 components: { 7 FilerobotImageEditorVue3, 8 }, 9 setup() { 10 const editorRef = ref(null); 11 12 const editorConfig: IFilerobotImageEditorConfig = { 13 tools: [TOOLS.CROP, TOOLS.RESIZE], 14 tabs: [TABS.ADJUST, TABS.FILTERS], 15 source: 'https://example.com/image.jpg', 16 language: 'en', 17 }; 18 19 return { editorConfig, editorRef }; 20 }, 21}; 22</script> 23 24<template> 25 <div> 26 <FilerobotImageEditorVue3 ref="editorRef" :config="editorConfig" /> 27 </div> 28</template>
Prop | Type | Description |
---|---|---|
config | IFilerobotImageEditorConfig | Configuration object for tools and tabs. |
You can use the exported types for configuration:
1import type { IFilerobotImageEditorConfig, TOOLS, TABS } from 'filerobot-image-editor-vue3' 2 3const editorConfig: IFilerobotImageEditorConfig = { 4 tools: [TOOLS.CROP, TOOLS.RESIZE], 5 tabs: [TABS.ADJUST, TABS.FILTERS], 6}
The config
prop is an object that follows the IFilerobotImageEditorConfig
interface. Below is a breakdown of the available configuration options:
theme
: (optional) The theme of the editor ('light'
or 'dark'
).source
: The source of the image to be edited. Can be a URL string or an HTMLImageElement
.language
: (optional) Language for the editor interface. Supported languages include: 'en'
, 'fr'
or a custom language string.translations
: (optional) A custom translation object to localize the editor text.Text Annotation (Text
):
fonts
: (optional) An array of font options available for text annotations.onFontChange
: (optional) Callback triggered when the font is changed.Crop Tool (Crop
):
minWidth
, minHeight
: Minimum width and height for the crop tool.ratio
: Defines the aspect ratio for cropping ('original'
, 'custom'
, 'ellipse'
, or a numeric value).presetsItems
: (optional) Predefined crop ratio options (e.g., '16:9'
).Watermark Tool (Watermark
):
gallery
: (optional) List of available watermarks.onUploadWatermarkImgClick
: (optional) Function to handle watermark image uploads.onBeforeSave
: (optional) Callback function to run before saving the image.onSave
: (optional) Callback function to run when saving the image.onClose
: (optional) Callback function when closing the editor, with parameters for the reason and unsaved changes.The config
prop allows you to fully customize the behavior and appearance of the image editor. You can control the available tools, event handlers, and even integrate with cloud services such as Cloudimage. This package provides a simple and flexible solution for adding image editing features to your Vue 3 applications.
MIT License - see LICENSE for details.
No vulnerabilities found.
No security vulnerabilities found.