-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
tubingbing
committed
Aug 6, 2021
1 parent
993f5c7
commit 76e9a0d
Showing
8 changed files
with
58 additions
and
178 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,7 +30,7 @@ npm i h5-imageviewer | |
|
||
Or get it from CDN: | ||
|
||
[https://unpkg.com/[email protected].5/umd/h5-imageviewer.js](https://unpkg.com/[email protected].5/umd/h5-imageviewer.js) | ||
[https://unpkg.com/[email protected].7/umd/h5-imageviewer.js](https://unpkg.com/[email protected].7/umd/h5-imageviewer.js) | ||
|
||
# Usage | ||
Show single image viewer | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,14 +5,14 @@ | |
<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].5/umd/h5-imageviewer.js"></script> | ||
<script src="https://unpkg.com/[email protected].7/umd/h5-imageviewer.js"></script> | ||
<script src="./vconsole.min.js"></script> | ||
<script> | ||
// init vConsole | ||
var vConsole = new VConsole(); | ||
function showImage() { | ||
H5ImageViewer.showViewer( | ||
{src: 'http://localhost:8080/737a71084999bb9ee329f7afead08564.jpg'}, | ||
{src: 'https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fp4.itc.cn%2Fimages03%2F20200524%2Fd9956119bbf14507ad0da4b2eb5ebaf2.jpeg&refer=http%3A%2F%2Fp4.itc.cn&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1630825813&t=9ab51af91811885dfbc0bbd62a350b4a'}, | ||
{ | ||
onPageChanged: pageIndex => { | ||
console.log('onPageChanged', pageIndex) | ||
|
@@ -23,8 +23,8 @@ | |
function showImageList() { | ||
H5ImageViewer.showImgListViewer( | ||
[ | ||
{src: 'http://localhost:8080/737a71084999bb9ee329f7afead08564.jpg'}, | ||
{src: 'http://localhost:8080/2e0036ab635f5b7dbcef2ca82b1cdca5.jpg'} | ||
{src: 'https://ss1.baidu.com/-4o3dSag_xI4khGko9WTAnF6hhy/zhidao/pic/item/78310a55b319ebc4cbd4c3e68226cffc1e171624.jpg'}, | ||
{src: 'https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fimg.yxbao.com%2Fpic%2F201304%2F27%2F1367051246_775420415_2c.jpg&refer=http%3A%2F%2Fimg.yxbao.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1630825813&t=6071ac7ff2a42786d351d2c3cb3fa9f5'} | ||
], | ||
{ | ||
onPageChanged: pageIndex => { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
const rules = [ | ||
{ | ||
test: /.js$/, | ||
use: 'babel-loader' | ||
}, | ||
{ | ||
test: /.css$/, | ||
use: [ | ||
'style-loader', | ||
'css-loader' | ||
] | ||
}, | ||
{ | ||
test: /.less$/, | ||
use: [ | ||
'style-loader', | ||
'css-loader', | ||
'less-loader', | ||
{ | ||
// css3前缀自动补全 | ||
loader: 'postcss-loader', | ||
options: { | ||
plugins: () => [ | ||
require('autoprefixer')({}) | ||
] | ||
} | ||
} | ||
] | ||
}, | ||
{ | ||
test: /.(jpg|png|gif|jpeg)$/, | ||
use: [ | ||
{ | ||
loader: 'url-loader', | ||
options: { | ||
limit: 10240, | ||
name: '[name]_[hash:8].[ext]' | ||
} | ||
} | ||
] | ||
} | ||
] | ||
|
||
module.exports = { rules } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters