at first, I didn"t know how to set click events for the Dropdown component, but then I found a blog based on the search, but to no avail, post the code:
< Dropdown trigger= "click" on-click= "changeDate" >
<a href="javascript:void(0)" name="weekPlan" v-html="this.MenuText">
<Icon type="ios-arrow-down"></Icon>
</a>
<DropdownMenu slot="list">
<DropdownItem name="weekPlan"></DropdownItem>
<DropdownItem name="monthPlan"></DropdownItem>
<DropdownItem name="yearPlan"></DropdownItem>
</DropdownMenu>
</Dropdown>
MenuText: "this week" is defined in
data, and method is defined in
methods:
changeDate (name) {
alert("" + name)
if (name === "weekPlan") {
this.MenuText = ""
} else if (name === "monthPlan") {
this.MenuText = ""
} else {
this.MenuText = ""
}
}
can you help find the error or give a better solution