This package includes a javascript ipreview.js
that would preview an image before upload or any subsequent manipulation.
The package does not provide any server side functionality.
This package uses Bootstrap 4 and Font Awesome 5.
You must include these in the head
of your HTML/PHP/template.
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.2/css/bootstrap.min.css">
<link href="https://use.fontawesome.com/releases/v5.2.0/css/all.css" rel="stylesheet">
The package uses Vue JS, hence you need to include Vue. Also, include the file ipreview.js from the /js folder.
A sample index.html
has been provided for reference.
First, you would need to declare a div
with id "profile".
<div id="profile">
Inside this div, use the component <image-uploader></image-uploader>
<image-uploader source="/initial/image/source.jpg" source-id="an-id-for-your-image"></image-uploader>
The source-id
would be used to define the name
as well as id
attributes of the component. So, if you want to submit a form, this is what the request would submit.