Sharing tips on using vue element and nuxt

Sharing tips on using vue element and nuxt

1. Element time selection submission format conversion

For example

Fri Sep 07 2018 00:00:00 GMT+0800 (China Standard Time)
Converted to 2020-01-11 format

This record adds a sentence value-format="yyyy-MM-dd" to the datepicker

<el-date-picker type="date" v-model="createdate" @change="formatTime" value-format="yyyy-MM-dd" placeholder="Select time"></el-date-picker>

2. The problem of not being able to select the checkbox when dynamically looping

this.menulist[index].sonList.map((item)=>{
  this.$set(item, 'checked', false); ---Use Vue's set attribute to assign a value})

3.el-form dynamic form verification (v-if, v-show cause verification failure bug)

When using v-if or v-show to control the display and hiding of el-form-item, a validation failure bug will occur.

When using v-if:element to bind validation rules to subcomponents with prop attributes in the form, it is completed in the vue declaration cycle mounted. The elements used by v-if to switch will be destroyed, resulting in the form items in v-if not being rendered during the mounted period, so the rules are not

There is binding. At initialization, rules that do not meet the display conditions will not be generated, resulting in the subsequent switching of conditions, and the verification of the displayed input box will not take effect. Use v-show: All rules will be generated at initialization, and rule verification will be performed even if they are hidden.

Solution (1): Use v-if to verify. Configure a different key value after each v-if.

(2) Customized validation rules. If you like to do it yourself, you can customize the validation yourself.

4. How to add Devtools to nuxt

The following must be added to nuxt.config.js:

vue: {
 config: {
  productionTip: false,
  devtools: true
 }
}

The above is the detailed content of sharing the usage tips of vue element and nuxt. For more information about vue element and nuxt, please pay attention to other related articles on 123WORDPRESS.COM!

You may also be interested in:
  • Some tips for using less in Vue projects
  • 22 Vue optimization tips (project practical)
  • Vue.js performance optimization N tips (worth collecting)
  • Summary of practical skills commonly used in Vue projects
  • Summary of 10 advanced tips for Vue Router
  • 8 tips for Vue that you will learn after reading it
  • Summary of common routines and techniques in Vue development
  • A brief discussion on the use of Vue functional components
  • 6 tips for writing better v-for loops in Vue.js
  • 25 Vue Tips You Must Know

<<:  Native JavaScript to implement random roll call table

>>:  Simple usage example of vue recursive component

Recommend

Tutorial on installing mysql5.7.18 on mac os10.12

I searched the entire web and found all kinds of ...

WEB Chinese Font Application Guide

Using fonts on the Web is both a fundamental skill...

Zabbix's psk encryption combined with zabbix_get value

Since Zabbix version 3.0, it has supported encryp...

Detailed explanation of Mysql communication protocol

1.Mysql connection method To understand the MySQL...

Use CSS variables to achieve cool and amazing floating effects

Recently, I found a fun hover animation from the ...

Hyperlink icon specifications: improve article readability

1. What is the hyperlink icon specification ?<...

MySQL 8.0.21 installation tutorial under Windows system (illustration and text)

Installation suggestion : Try not to use .exe for...

A brief discussion of 3 new features worth noting in TypeScript 3.7

Table of contents Preface Optional Chaining Nulli...

Should I use UTF-8 or GB2312 encoding when building a website?

Often when we open foreign websites, garbled char...

Summary of common docker commands

Docker installation 1. Requirements: Linux kernel...

MySQL Series 13 MySQL Replication

Table of contents 1. MySQL replication related co...

Three ways to copy MySQL tables (summary)

Copy table structure and its data The following s...

Analysis of the process of implementing Nginx+Tomcat cluster under Windwos

Introduction: Nginx (pronounced the same as engin...

Tutorial on using iostat command in Linux

Preface It is said that if the people doing opera...