Vue project @change multiple parameters to pass multiple events

Vue project @change multiple parameters to pass multiple events

First, there is only one change event.

 changelevel() //Select value

If you want to change the select and change the value in the row

Multiple events are separated by

At this time, it is found that changelevel() is not executed, so what about adding ()

 changelevel(val){ console.log(val) => //undefined}

Indicates that no parameters are passed and output is undefined

So who should we pass the value to?

Pass in $event and output it again to get the selected value

Added: element-ui @change adds custom parameters

The default parameter of the change event of element-ui is a value. For example, the default parameter of the change event of the drop-down box is the selected value. However, in actual projects, we usually need to pass more than one parameter. If we directly append two parameters, we may not get them. In this case, we need to replace the default parameter name in the parameter with $event.

//The first parameter is the default value parameter, and the second is the parameter we want to pass in

 @change='selectChange($event,scope.row)'

Or use the second method:

 @change='(val)=>selectChange(value,scope.row)'

The above is my personal experience. I hope it can give you a reference. I also hope that you will support 123WORDPRESS.COM. If there are any mistakes or incomplete considerations, please feel free to correct me.

You may also be interested in:
  • In element-ui, the select component binding value changes, triggering the change event method
  • Solve the triggering problem of change event when vue elementUI uses el-select
  • How to pass custom parameters in vue select change event

<<:  Mysql5.7 service cannot be started. Graphical solution tutorial

>>:  MySQL SQL statement method to hide the middle four digits of the mobile phone number

Recommend

Detailed Analysis of the Selection of MySQL Common Index and Unique Index

Suppose a user management system where each perso...

Discussion on horizontal and vertical centering of elements in HTML

When we design a page, we often need to center th...

MySQL uses custom functions to recursively query parent ID or child ID

background: In MySQL, if there is a limited level...

Detailed introduction to CSS font, text, and list properties

1. Font properties color, specifies the color of ...

How to clean up the disk space occupied by Docker

Docker takes up a lot of space. Whenever we run c...

Linux system repair mode (single user mode)

Table of contents Preface 1. Common bug fixes in ...

CSS solves the misalignment problem of inline-block

No more nonsense, post code HTML part <div cla...

Sample code for using CSS to write a textured gradient background image

The page length in the project is about 2000px or...

Detailed explanation of the execution process of mysql update statement

There was an article about the execution process ...

MySQL 8.0.12 installation and configuration graphic tutorial

Recorded the download and installation tutorial o...

Vue template compilation details

Table of contents 1. parse 1.1 Rules for intercep...

Learn the black technology of union all usage in MySQL 5.7 in 5 minutes

Performance of union all in MySQL 5.6 Part 1:MySQ...

js canvas realizes rounded corners picture

This article shares the specific code of js canva...

Detailed analysis of several situations in which MySQL indexes fail

1. Leading fuzzy query cannot use index (like ...