应用场景: 当图片文字太小,需要触摸手动放大显示。
- 组件js
import Taro from '@tarojs/taro' import {Image} from '@tarojs/components' export default class ScaleImage extends Taro.Component { constructor() { super(...arguments) this.state = { offsetX: 0, offsetY: 0, zoom: false, distance: 0, scale: 1 } this.startX = 0; this.startY = 0; } render() { let {scale} = this.state; let {imageSrc} = this.props; return ( <Image src=