Home > WeChat Applet > Mini Program Development > The implementation process of custom sharing buttons in WeChat mini programs

The implementation process of custom sharing buttons in WeChat mini programs

不言
Release: 2018-09-06 10:02:08
Original
5754 people have browsed it

The content of this article is about the implementation process of custom sharing buttons in WeChat applet. It has certain reference value. Friends in need can refer to it. I hope it will be helpful to you.

1. Declare the onShareAppMessage function

onShareAppMessage() {
         return {
       title: '弹出分享时显示的分享标题'
        desc: '分享页面的内容',
        path: '/page/user?id=123' // 路径,传递参数到指定页面。
 
    }
      },
Copy after login

2. To customize the button, you need to write the open-type='share' attribute on the button label and write the button component in the dom

<button open-type=&#39;share&#39;>分享</button>
Copy after login

3. Generally, the styles of custom buttons and button components will conflict. The following code is to change the style of the button component:

button::after {
  border: none;
      }
      button {
  background-color: #fff;
     }
Copy after login

Remove the border and background color, and it will be ok.

Related recommendations:

WeChat Mini Program Example: Custom Sharing Function Implementation Code

WeChat Mini Program Example: WeChat Mini Program Implementation code of pop-up window

The above is the detailed content of The implementation process of custom sharing buttons in WeChat mini programs. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template