Get the App
SLTechnology News&Howtos  ›  Development  › 

How to solve the problems encountered in WeChat Mini Programs's development

Shulou Source: shulou.com Published: 2022-05-31 21:01:36 09月21日 Update

Today, the editor will share with you the relevant knowledge points on how to solve the problems encountered in WeChat Mini Programs's development. The content is detailed and the logic is clear. I believe most people still know too much about this knowledge, so share this article for your reference. I hope you can get something after reading this article. Let's take a look at it.

Data data update

Directly assigning a value to this.data cannot update the data bound by the view, which will cause data inconsistency.

Need to update with this.setData

This.data.key = valuethis.setData ({key: value}) require

Absolute paths are not supported at this time

Const util = require ('.. /.. / utils/util.js') background-image

Static files cannot be used, only base64 and network pictures can be used.

Can be used

Solve

Background: # fff url (data:image/jpeg;base64,***) component style

The style of app.wxss cannot be applied inside the component

You can reference import as needed: ""

@ import "/ app.wxss"; textarea

The textarea default style has a fixed width

Event parameter transfer

Events in the template cannot pass parameters

Use event.currentTarget.dataset to get

Click me! Page ({tapName (event) {console.log (event.currentTarget.dataset.hi)}}) animation

Animation cannot be directly bound to the component in progress.

Wrap it on the outside

CheckBox

The bindChange event bound by checkbox-group. Clicking on the checkbox event in us will bubble up, causing the outer layer to be clicked.

CheckBox wraps a layer of view around it, adding a catch event to view.

Tags: Events knowledge articles updates data styles components problems small programs development content different large consistent top picture outer layer most width that is Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Tech Info Shulou Technology macOS Xiaomi MariaDB