Tencent low-code navigation component realizes switching effect

table of Contents

Define event

In the previous article, we introduced the basic effects of the navigation component, but only defined the data, and the specific switching effects have not yet been achieved. In this section, we introduce how to click the category to switch the category tab.
Open the low-code console, select the navigation component, and click low-code edit.
Insert picture description here
Find the page where you need to create a method, and click the + sign of the handler to create a method, which is defined as the onClickSidebar
Insert picture description here
method body and copy the following code

$page.dataset.state.selectedType = event.detail.data.target

Then switch to the event tab and select the method just defined
Insert picture description here
. After you have selected it, you can click on math, and the tab will switch to math
Insert picture description here

Guess you like

Origin blog.csdn.net/u012877217/article/details/112865907
Recommended