search
HomeWeChat AppletMini Program DevelopmentHow to use WeChat SlideView component in WeChat applet (with examples)

How to use WeChat SlideView component in WeChat applet (with examples)

Oct 24, 2018 am 11:52 AM
javascriptfront endWeChat applet

The content of this article is about how to use the WeChat SlideView component (with examples) in the WeChat applet. It has certain reference value. Friends in need can refer to it. I hope it will be helpful to you.

WeChat applet imitates WeChat SlideView component.

Use

1. Install slide-view

from the mini program base library version 2.2.1 or above, and developer tools 1.02.1808300 or Starting from the above, the mini program supports using npm to install third-party packages.

npm install --save miniprogram-slide-view

2. Add slide-view custom component configuration in page.json of the page that needs to use slide-view

{  
    "usingComponents": {    
        "slide-view": "miniprogram-slide-view"
    }
}

3. Reference slide-view in the WXML file

Each slide-view provides two nodes, which are used to carry the child nodes provided when the component is referenced. The left node is used to carry the node displayed by slide-view when it is still. The width and height of this node should be the same as the width and height passed in to slide-view. The right node is used to host the node displayed when sliding, and its width should be the same as the slideWidth passed in to slide-view.

<slide-view>
  <view>这里是插入到组内容</view>
  <view>
    <view>标为已读</view>
    <view>删除</view>
  </view>
</slide-view>

Parameter description:

  • width: Number type, the default value displays the width of the screen, the width of the slide-view component

  • height: Number type, default value 0, the height of the slide-view component

  • slide-width: Number type, default value 0, the width of the sliding display area (the default height is the same as the slide -view is the same)

Running effect

How to use WeChat SlideView component in WeChat applet (with examples)

Others

slide-view project address: https://github.com/wechat-min...

The above is the detailed content of How to use WeChat SlideView component in WeChat applet (with examples). For more information, please follow other related articles on the PHP Chinese website!

Statement
This article is reproduced at:segmentfault思否. If there is any infringement, please contact admin@php.cn delete

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool