text nested text tag, click event fails

The company's applet needs to add a requirement to copy the order number. Originally the order number was displayed using a text tag. When adding a button, I naturally thought of nesting a text tag inside it, and then added a click event bindtap, but this event It didn't work at all. Even if I printed a string of numbers randomly, it wouldn't come out. Then I started troubleshooting the problem.
The first thing I tried was that it might be a level problem. The button couldn't be clicked, so the click time didn't take effect. So I gave the button a relative position and a level of 999, but it still didn't work. Then I wondered if the text tag couldn't nest text. Regarding the problem of tags, various Baidu later found that there was no problem that they could not be nested, and the official documents also clearly stated that it was possible and only text could be nested.

Then I tried changing the outermost text to the view tag, and it worked. After checking the information, many people say that the problem is caused by nesting texts into each other. It is probably an official bug. This article is to remind everyone of my own mistakes~

Key points:

If text is nested with text tags, the bintap click event will be invalid. Just replace the outer text tag with the view tag!

Guess you like

Origin blog.csdn.net/weixin_44309299/article/details/129932816