Merge branch '3.x' of gitee.com:openharmony-tpc/ImageKnife into 3.x
This commit is contained in:
commit
400ba85a5d
|
@ -18,20 +18,20 @@ import { ImageKnifeComponent, ImageKnifeOption } from '@ohos/imageknife';
|
|||
@Component
|
||||
struct ListPage {
|
||||
|
||||
private datas: string[] = []
|
||||
private data: string[] = []
|
||||
@State ImageKnifeOption: ImageKnifeOption = { loadSrc: $r('app.media.startIcon')}
|
||||
|
||||
|
||||
aboutToAppear(): void {
|
||||
for (let i = 0; i < 1000; i++) {
|
||||
this.datas.push(i.toString())
|
||||
this.data.push(i.toString())
|
||||
}
|
||||
}
|
||||
|
||||
build() {
|
||||
Row() {
|
||||
List({ space: 10 }) {
|
||||
ForEach(this.datas, (item: string) => {
|
||||
ForEach(this.data, (item: string) => {
|
||||
ImageKnifeComponent({ imageKnifeOption: this.ImageKnifeOption }).height(200).width(200)
|
||||
}, (item: string) => item)
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@ export struct UserAvatar {
|
|||
imgSizes: number = 1
|
||||
@State ImageKnifeOption: ImageKnifeOption = new ImageKnifeOption()
|
||||
@StorageProp('WeLink_Mob_fontSize_multiple') @Watch('updateImgSize') WeLink_Mob_fontSize_multiple: number = 0
|
||||
scaleable: boolean = true;
|
||||
scalable: boolean = true;
|
||||
@State calcImgSize: number = 100
|
||||
|
||||
aboutToAppear(): void {
|
||||
|
@ -25,7 +25,7 @@ export struct UserAvatar {
|
|||
}
|
||||
|
||||
setImageSize() {
|
||||
if (!this.scaleable) {
|
||||
if (!this.scalable) {
|
||||
this.calcImgSize = this.imgSize
|
||||
} else if (this.WeLink_Mob_fontSize_multiple < 0.9) {
|
||||
this.calcImgSize = this.imgSize * 0.9
|
||||
|
|
Loading…
Reference in New Issue