当前位置:网站首页>Innovation training (XI) summary of some bugs in the development process
Innovation training (XI) summary of some bugs in the development process
2022-06-12 13:11:00 【Pushi resolution】
Preface
This is of great significance to the development process 、 It's difficult bug Records and summary of .
modify bug Documents consulted 、 At least hundreds of blogs , It is a lesson of blood and tears .
Record here , One is to prove your own development process , The second is summary , Avoid repeating mistakes .
1、 The custom rule and binding form are as follows :
Note that the rule name should not contain such as “name” This keyword , Otherwise, an error will be reported
Taskform: {
Task_name: "",
Task_class: "",
Task_minmember: 1, // Minimum number of people , Set up 1-10
Task_model: "", // Model (py file , The format is predetermined , The storage location has not been determined yet ) Here, the front-end should realize the file selection function
Task_premodel: true, // Default True It's random generation . Preprocessing model ( The initial model , optional , The default is random , The storage location has not been determined yet )
Task_dataset: "", // Datasets are optional ( Save on the training side , Different training end data sets are independent )
},
rules:
{
Task_name: [
{
required: true,
message: " Please enter the task name ",
trigger: "blur",
},
{
min: 3,
max: 20,
message: " The length should be 3-20 Between characters ",
trigger: "blur",
},
],
},
2、input Input box icon does not show the problem
Refer to the following , Use slots to solve
elementPlus Use icon The icon does not show the solution _ Little black ya_ The blog of -CSDN Blog _element icon Unable to display
Icon Icon | Element Plus (gitee.io)
Or directly ,prefix-icon Don't precede it with a colon , Can also be :
<el-input clearable :input-style="{ 'user-select': 'none' }" v-model="ruleForm.username" placeholder=" account number " prefix-icon="Key" >
</el-input>
3、Tailwind! I have been looking for this for a long time ! It can be realized directly in class Enter a style in .
Tailwind CSS Chinese document - No need to leave your HTML, You can quickly build a modern website .
stay Vue 3 and Vite install Tailwind CSS - Tailwind CSS Chinese document
Don't forget to install and generate and modify configuration files !
The original template used unocss, But there is no proper documentation , I used this .
4、 Methods for importing third-party icon libraries
5、 Click to log in and only change the address page without refreshing
Use element When the plug-in clicks jump, an error occurs form-item.vue:315 Uncaught (in promise) TypeErelForm.removeField is not a function_if The blog of time coming back -CSDN Blog
Here's another thing to note , be-all el-form-item Items must be wrapped in el-form within ! You can't pull it out alone like a template !
6、 Radio box here label Binding values can only be of type string/int, Therefore, the bound data is better not to use Boolean type , Here we use 01 replace .
Don't forget to put a colon here !
<el-form-item label=" The initial model " prop="Task_premodel">
<el-radio-group v-model="Taskform.Task_premodel">
<el-radio :label=0 @click="premodle_fromuser(false)" > Random generation </el-radio >
<el-radio :label=1 @click="premodle_fromuser(true)" > Optional </el-radio >
</el-radio-group>
7、 Properties of components , Don't forget to add... At the beginning of some binding : The colon !
8、 Parameter passing during page Jump , Use params How to achieve .
Vue3x Route jump and parameter transmission (useRouter)_ Yunfei's blog -CSDN Blog _vue.use(router)
9、 Theme color dark mode is introduced
Resolve errors :Module not found: Error: Can‘t resolve ‘element-plus/lib/theme-chalk/index.css‘_ The coder's blog -CSDN Blog
It has been written here for a long time .element There is something wrong with the official statement , It is equivalent to introducing an officially written css file . stay index.html Introduction in . But there is no way to switch ?
Then how to switch ? I used the most primitive dom The tree gets the whole html file , Then the event triggered by the button click is to change the whole html The class name of , It's a coincidence .
in general , It is equivalent to introducing an officially written css file . stay index.html Introduction in , Write the class name as dark, You can achieve dark mode .
But there is no way to switch ? Easy to handle , Give me a button , You can control the class name of the entire page .
How to control ? Here we use Vue Conventional means are difficult to achieve , So I used my head , The decision was simple and rough , Use the most primitive HTML Getting and manipulating DOM Tree method . Get the entire DOM object , And then use JavaScript To change the class name !
changeTheme(){
// Here we use a very primitive dom Trees , The last resort belongs to
if(this.dark){
document.getElementsByClassName("WholePage")[0].setAttribute("class","WholePage dark");
}
else{
document.getElementsByClassName("WholePage")[0].setAttribute("class","WholePage");
}
},
10、icon Icon import
elementplus Self contained icon That's enough . However, the method of importing to the official website often fails .
Two solutions .
The first one is , no need :icon=“ name ”, Instead of directly <el-icon><Notebook /></el-icon>
The second kind , Some users must only fill in their names , First of all import, And then in data It's like this
Edit: Edit,
Picture: Picture,
UploadFilled: UploadFilled,
, Then you can enter the name directly .
11、 The guide page
For new users , The boot page is a very practical design . It's used here dirver.js Third party Library .
Official address :
kamranahmedse/driver.js: A light-weight, no-dependency, vanilla JavaScript engine to drive the user’s focus across the page (github.com)
You can also refer to this blog :
Vue Page guidance effect ( First login new user boot ) driver.js The guide page _ weave _ Web blog -CSDN Blog _vue Guide page prompt function development
Specifically, in layout Write well driver example , establish step.js file , stay mounted Function is initialized , Then call the method of the parent component on the button of the child component (this.$parent.method()), You can start the boot page operation .
12、 Use Depcheck Third party libraries are removed VUE Unnecessary dependency packages
Reference resources :https://blog.csdn.net/zhuzhoulin/article/details/114824714
D:\workplace\asynchronous-ldx-new\asynchronous-federated-learning-visual-platform\Client\client_front\node_modules\.bin>.\depcheck D:\workplace\asynchronous-ldx-new\asynchronous-federated-learning-visual-platform\Client\client_front
Unused dependencies
* core-js
* depcheck
* qs
Unused devDependencies
* @babel/core
* @babel/eslint-parser
* @vue/cli-plugin-babel
* @vue/cli-plugin-eslint
* autoprefixer
* less
* less-loader
* node-sass
* postcss
* sass-loader
* tailwindcss
* unocss
Missing dependencies
* dayjs: .\src\view\About.vue
core-js depcheck qs
@babel/core @babel/eslint-parser @vue/cli-plugin-babel @vue/cli-plugin-eslint autoprefixer less less-loader node-sass postcss sass-loader tailwindcss unocss
边栏推荐
- 智能垃圾桶语音芯片应用设计方案介绍,WT588F02B-8S
- 2022 ARTS|Week 23
- Theoretical knowledge of improved DH parameters and standard DH parameters of manipulator
- Bitmap, bloom filter and hash sharding
- 【云原生 | Kubernetes篇】深入了解Ingress
- Hardware composition of embedded system - introduction of embedded development board based on ARM
- 5V升压到12.6V的锂电池充电IC芯片方案FS4062B
- 苹果电脑上MySQL安装完成找不到怎么办
- import torch_ Geometric loads some common datasets
- 一行代码实现shell if else逻辑
猜你喜欢

torch_geometric mini batch 的那些事

Pytoch official fast r-cnn source code analysis (I) -- feature extraction

Share PDF HD version, series

Constant time delete / find any element in array

leetcode 47. Permutations II full permutations II (medium)

Freshman girls' nonsense programming is popular! Those who understand programming are tied with Q after reading

Source of routing information

ITK multiresolution image itk:: recursivemultiresolutionpyramidimagefilter

STM32F1与STM32CubeIDE编程实例-设备驱动-EEPROM-AT24C256驱动

嵌入式系统硬件构成-基于ARM的嵌入式开发板介绍
随机推荐
Array -- fancy traversal technique of two-dimensional array
Further understanding of the network
R language Visual facet chart, hypothesis test, multivariable grouping t-test, visual multivariable grouping faceting bar plot, adding significance level and jitter points
VTK three views
ITK Examples/RegistrationITKv4/DeformableRegistration
【微信小程序开发】第1篇:开发工具安装及程序配置
Online picture material
442个作者100页论文!谷歌耗时2年发布大模型新基准BIG-Bench | 开源
R语言ggplot2可视化:使用ggrepel包在线图(line plot)的尾端那个数据点添加数值标签(number label)
Newton method for solving roots of polynomials
【刷题篇】抽牌获胜的概率
用PyTorch进行语义分割
嵌入式系統硬件構成-基於ARM的嵌入式開發板介紹
【云原生 | Kubernetes篇】Kubernetes 网络策略(NetworkPolicy)
442 authors, 100 pages! It took Google 2 years to release the new benchmark big bench | open source
torch_ geometric message passing network
Will the next star of PPT for workplace speech be you [perfect summary] at the moment
Openstack network
Semantic segmentation with pytorch
嵌入式系统硬件构成-嵌入式系统硬件体系结构
