Skip to content

Commit

Permalink
docs: cdn import opt
Browse files Browse the repository at this point in the history
  • Loading branch information
tubingbing committed Jul 31, 2021
1 parent 4185391 commit 993f5c7
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ npm i h5-imageviewer
```

Or get it from CDN:
[https://unpkg.com/[email protected]/umd/pobi-imageviewer.js](https://unpkg.com/[email protected]/umd/pobi-imageviewer.js)

[https://unpkg.com/[email protected]/umd/h5-imageviewer.js](https://unpkg.com/[email protected]/umd/h5-imageviewer.js)

# Usage
Show single image viewer
Expand All @@ -47,7 +48,7 @@ viewer.showImgListViewer(imgObjList, options)
viewer.hideImgListViewer()
```

Please check [EXAMPLE](https://github.com/TUBB/h5-imageviewer/blob/master/src/example/example.js) for detail.
Please check [EXAMPLE1](https://github.com/TUBB/h5-imageviewer/blob/master/src/example/example.js) or [EXAMPLE2](https://github.com/TUBB/h5-imageviewer/tree/master/public/cdn-test.html) for detail.

# Apis

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "h5-imageviewer",
"version": "0.7.4",
"version": "0.7.5",
"description": "Image viewer for mobile browser, supported React/Vue/AngularJS.",
"main": "bundle.js",
"files": [
Expand Down
6 changes: 3 additions & 3 deletions public/cdn-test.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no, viewport-fit=cover">
<meta name="format-detection" content="telephone=no">
<title>H5 mobile image viewer</title>
<script src="https://unpkg.com/[email protected].4/umd/pobi-imageviewer.js"></script>
<script src="https://unpkg.com/[email protected].5/umd/h5-imageviewer.js"></script>
<script src="./vconsole.min.js"></script>
<script>
// init vConsole
var vConsole = new VConsole();
function showImage() {
PobiImageViewer.showViewer(
H5ImageViewer.showViewer(
{src: 'http://localhost:8080/737a71084999bb9ee329f7afead08564.jpg'},
{
onPageChanged: pageIndex => {
Expand All @@ -21,7 +21,7 @@
)
}
function showImageList() {
PobiImageViewer.showImgListViewer(
H5ImageViewer.showImgListViewer(
[
{src: 'http://localhost:8080/737a71084999bb9ee329f7afead08564.jpg'},
{src: 'http://localhost:8080/2e0036ab635f5b7dbcef2ca82b1cdca5.jpg'}
Expand Down
4 changes: 2 additions & 2 deletions webpack.pro.script.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ module.exports = {
entry: './src/index.js',
output: {
path: path.resolve(__dirname, 'umd'),
filename: "pobi-imageviewer.js",
filename: "h5-imageviewer.js",
libraryExport: "default",
libraryTarget: "umd",
library: "PobiImageViewer"
library: "H5ImageViewer"
},
module: {
rules: [
Expand Down

0 comments on commit 993f5c7

Please sign in to comment.