代码演示

基本形式

<img title='点击查看预览' on-click={this.show()} width=100 src = 'http://gacha.nosdn.127.net/639562a1f83047ffa4ae411c6aa49fa0.jpeg?imageView&type=jpg&enlarge=1&quality=100&axis=0'>
var component = new JRUI.Component({
template: template,
show(){
(new JRUI.JRImagePreview({
data:{
"imageList":[
{
name: 'test.jpeg',
src: 'http://gacha.nosdn.127.net/639562a1f83047ffa4ae411c6aa49fa0.jpeg?imageView&type=jpg&enlarge=1&quality=100&axis=0'
},
{
name: 'test2.jpg',
src: 'http://gacha.nosdn.127.net/bd8705b5782841dc9e36b8af2cc77aba.jpeg?imageView&type=jpg&enlarge=1&quality=100&axis=0'
}, {
name: 'test3.jpeg',
src: 'http://gacha.nosdn.127.net/b288f65765cd4f0da3775c2228d1f182.jpg?imageView&type=jpg&enlarge=1&quality=100&axis=0'
},
{
name: 'test4.jpg',
src: 'http://gacha.nosdn.127.net/ec3004a7ea034ffda67126f933edaed1.jpeg?imageView&type=jpg&enlarge=1&quality=100&axis=0'
}
],
curIndex:1,
}
})).$inject(document.body)
},
});

API

Classes

JRImagePreview

Constants

Component

JRImagePreview 图片预览

JRImagePreview

Kind: global class
Extend: Component

new JRImagePreview()

Param Type Default Description
[options.data] object = 绑定属性
[options.data.imageList] array => 必选,图片文件列表, 其中每个文件项包含下面的字段: name: 图片文件名称 src: 图片文件的路径
[options.data.curIndex] number 0 => 必选,当前图片文件的索引, 默认第一项为当前项

Component


JRImagePreview 图片预览

Kind: global constant