How Can I Implement the Function of Touching and Holding an Image to Save It in Quick Apps

Scenario Description

WeChat mini programs allow you save images to the album by touching and holding them. Currently, HUAWEI Quick App does not have any API to implement this function, but you can trigger events to implement this function

All quick app elements support the longpress event. So you can use the image element to render images and trigger the longpress event on the element to implement the function.

Sample code

Reference: Quick app reference

--

--

--

Lead Developer Advocate for Huawei AppGallery | He/Him | All views are my own and do not represent the views of Huawei

Love podcasts or audiobooks? Learn on the go with our new app.

I am getting cheaper pricing for hosting from other providers. Why is your price high?

Why you shouldn’t use React / React Native

100 Days to Learning JavaScript

Java Interview Exercise 2

How To Take The Headache Out Of flexbox and Support Older browsers like IE in production

The JS canvas editor Pikaso has been around for a year 🎂

ES6 Destructuring in TypeScript

Debouncing vs Throttling

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Zachary Powell

Zachary Powell

Lead Developer Advocate for Huawei AppGallery | He/Him | All views are my own and do not represent the views of Huawei

More from Medium

Regular language and its Closure Properties

Using Fast JSON API Gem

Tree Traversal Using Tail Recursion

What is Version Control System ?