Business scenario: Use vue + element ui's el-dialog. After clicking the pop-up window, the data of the first button is loaded by default for initialization. div instruction: // Automatically trigger click events directives:{ trigger:{ inserted(el,binging){ // console.log("Automatically trigger events") el.click() } } }, PS: Let's take a look at vue automatically triggering click events Yes, click on the list on the left to get the details, but a click event is required. When the page comes in, the click event is triggered by default. Method 1, vue custom instructions directives:{ trigger:{ inserted(el, binging){ console.log(el.id) el.id == 'nav0' ? el.click() : null // Only click the first one, the id is manually added in the loop // $(el).trigger('click') // All are triggered once, then the last one} } }, usage: <span class="nav-item" :id="'nav' + index" v-trigger :class="{'active': item.stage == activeId}" @click="navClick(item)" v-for="(item, index) in nav" :key="item.stage">{{item.stage_name}}</span> The above is the detailed content of the solution (simulated scenario) for automatically triggering click events by clicking on the pop-up window of Vue. For more information about automatically triggering click events of Vue, please pay attention to other related articles on 123WORDPRESS.COM! You may also be interested in:
|
<<: Linux 6 steps to change the default remote port number of ssh
Effect html <body> <div class="cont...
Table of contents Explanation of v-text on if for...
1 Download the MySQL 5.6 version compressed packa...
About Docker Swarm Docker Swarm consists of two p...
VMWare (Virtual Machine ware) is a "virtual ...
This article example shares the specific code of ...
Table of contents Preface Local storage usage sce...
I like to pay attention to some news on weekdays a...
Table of contents Comprehensive comparison From t...
Preface In this article, we will use Docker to bu...
GNU Parallel is a shell tool for executing comput...
1. Do a good job of cleaning before installation ...
Table of contents 1. Introduction 2. Thought Anal...
Preface In the springboot configuration file, the...
This article introduces and shares the responsive...