ICode9

精准搜索请尝试: 精确搜索
  • 前端工作总结242-uni-提交成功加入表单验证2022-09-16 23:04:29

    增加验证规则 <u-form :model="form" :rules="rules" ref="uForm" :errorType="errorType"> <navigator url="../LevineHua-editor/LevineHua-editor" class="single"> <u-form-item label=&quo

  • vue中form验证2022-09-13 16:32:32

    一、问题 在开发中有这样一个需求,单击按钮会弹窗,填写表单后,触发验证提示信息。关闭弹窗后,在次打开,验证提示信息还会存在。这种不是太友好,所以在弹窗后,手动清除上一次的验证提示信息。 二、解决方案 1.清除表单内容和清除表单验证消息 this.$nextTick(()=>{ this.$refs['tes

  • $nextTick 的理解2022-09-13 00:31:15

    <template> <div> <div ref="msg">{{ message }}</div> <div>{{ message1 }}</div> <button @click="changeMessage">改变message</button> </div> </template> <script

  • this.$refs[formName].validate((valid) =>{} 无效,vue验证表单无效2022-08-31 10:35:03

    问题: this.$refs[formName].validate((valid) =>{} 无效的问题,当验证通过的时候点确定按钮没有报错,也没有任何反应。 背景: ruoyi前后端分离新项目,前端vue。 解决: 参考: this.$refs[formName].validate((valid) =>{} 无效 - 搬砖的苦行僧 - 博客园 (cnblogs.com) 每一个 if 都要对

  • 滑动加载2022-08-30 12:33:09

    html <div class="message-box" data-spy="scroll" data-target="#navbar-example" data-offset="0" ref="messageList" > </div>  js mounted() { // 缓存指针 let _this = this; // 注册scroll事件

  • elementui table 表格使用固定列(fixed)之后滚动表格出现错行问题2022-08-22 16:04:34

           效果图,如上图    这里是初始化表格数据的           beforeDestroy () { this.tableBodyWrapper.removeEventListener('scroll', this.setScrollTop); }, this.$nextTick(() => { setTimeout(() => { this.tableBodyWrapp

  • element的Cascader 级联选择器的使用及回显2022-08-18 15:01:34

    element的Cascader 级联选择器的使用及回显 element-ui组件库的Cascader 级联选择器,vue项目中经常能用到的一个组件,这次使用的是父子节点不相互关联,也就是可选择到任意一个节点,不需要强制选择到最末的一个节点,真香o( ̄▽ ̄)ブ      在使用时候简单讲述下遇到的困难,总感觉自己老遇

  • NLG常用metric整理2022-08-15 21:02:24

    概览 BLEU:基于比较词/短语的重叠比例,关注precision Rouge:基于比较词/短语的重叠比例,关注recall Meteor:基于比较词/短语的重叠比例,关注f1 Distinct: Perplexity: BLEU BLEU (其全称为Bilingual Evaluation Understudy), 其意思是双语评估替补。所谓Understudy (替补),意思是代替人进

  • Git fetch Pull Requests from Azure DevOps2022-08-10 15:30:38

    Git fetch Pull Requests from Azure DevOps 问题 I want to fetch, using git, the list of Pull Requests in a repository hosted in Azure DevOps. Github has the support. We can just add this to .git/config: [remote "origin"] fetch = +refs/pull/*/hea

  • [Bug0034] Git报错 cannot lock ref 'refs/heads/master': is at xxxx but expected xxx error:2022-07-28 20:34:07

    1、问题 error: update_ref failed for ref 'refs/heads/master': cannot lock ref 'refs/heads/master': is at 63654e79f7ae0f902731558b3ae6679a69db09e9 but expected ec20d6ffa52920358e54703f90100bedbca4c855 error: could not update refs/heads/mas

  • element-ui 之 select 获取key和label2022-07-26 15:35:31

    element-ui 之 select 获取key和label element 获取下拉框的key和label,  ---------个人理解: 这东西做的官方做的思考不全 01)使用循环 02) 使用 proxy.$refs 获取 <template> <div> <h3>下拉框 获取key和label</h3> <p> const {proxy} = getCurrentInstance(); </p>

  • vue 重置表单方法:this.$refs[formName].resetFields() 无效2022-07-26 00:02:03

    在ui-element 上的说明用this.$refs[formName].resetFields() 可以重置表单,试过了几次才发现要只用这种方式重置表单必须要在表单标签中加入prop 和required 属性,通过这种方式重置才有效果。 下面是通过console打印出来的内容: console.log( this.$refs[formName].resetFields)  

  • vue+ts使用$refs属性报错Property 'focus' does not exist on type 'Vue | Element | (Vue | Elem2022-07-25 09:02:49

    问题 项目中直接使用 this.$refs.searchInput.focus() 会报以下错误 Property 'focus' does not exist on type 'Vue | Element | (Vue | Element)[]' 原因 ts中类型不明确引起的 解决 先定义searchInput的类型,再进行后续操作 let SI:any=this.$refs.searchInput SI.focus()

  • Vue:ref2022-07-20 15:36:21

    ref 先说结论:vue中可以用ref属性代替id属性。 以前我们想要获取具体某个标签dom对象,要在标签上加个id="demo",然后通过document.geElementById("demo")来获取; 现在ref也能完成这个功能,并且可以用在子组件标签上。如下: <template> <div> <h1 v-text="msg" ref="title"></h1>

  • this.$refs使用方法2022-07-14 14:32:38

    this.$refs 在vue中ref可以以属性的形式添加给标签或者组件 ref 写在标签上时:this.$refs.ipt 获取的是添加了ref="ipt"标签对应的dom元素 ref 写在组件上时:this.$refs['component'] 获取到的是添加了ref="component"属性的这个组件 <template> //给标签使用 <input type="tex

  • vue封装原生的可预览裁剪上传图片插件H5,PC端都可以使用2022-07-09 12:34:17

    思路:1.先做出一个上传的图片的上传区 <!-- 上传区 --> <label for="fileUp"> <div class="upBorder"> <img src="../assets/add.png" alt="" /> <input ref="fileUp

  • Vue的特性(二):ref的作用及适用场景2022-07-08 12:01:00

    ref 预期:string 被用来给元素或子组件注册引用信息,引用信息将会注册在父组件的 $refs 对象上。 如果在普通的 DOM 元素上使用,引用指向的就是 DOM 元素;如果用在子组件上,引用就指向组件实例: <!-- `vm.$refs.p` will be the DOM node --> <p ref="p">hello</p> <!-- `vm.$refs.chi

  • vue ref 操作2022-07-07 23:02:48

    ref 的妙用 1、引用 dom 元素 <h1 ref="myh1">引用 dom 元素</h1> ​ <script> methods:{ show(){ this.$refs.myh1.stylt.color="red" //获取 dom 元素,使用 ref } } </script>   2、引用组件 点击父组件的按钮,调用子组件的实例

  • Refs and the DOM2022-07-06 10:35:20

    是什么? Refs 提供一种方式允许访问DOM节点或在render方法中创建的React元素。 为什么? 典型的React数据流中,props是父组件与子组件交互的唯一方式。修改一个子组件,需要使用新的props来重新渲染,但是某些情况下,需要在典型的数据流之外强制修改子组件。被修改的子组件可能是一个React

  • echarts 重复渲染警告 There is a chart instance already initialized on the dom2022-07-05 09:00:08

    项目中封装了echarts饼图,通过选择不同时间,像后端请求不同数据,频繁切换会出现“There is a chart instance already initialized on the dom.”的警告 这个问题的出现在于,在一张表上渲染不同数据,其实dom已经存在了,但是我们在每次数据发生改变的时间都重新进行了一次渲染,导致出现警

  • vue动态生成Input并在enter之后焦点往下切换2022-06-30 17:35:30

       简单实现逻辑,在第一个框摁下enter之后切换至下一个输入框,直接上代码 <el-table-column v-for="(item, index) in colList" :width="item.width || 150" :key="item.key" :label="item.label" :fixed="item.fixed">

  • vuex中mutations怎么调用2022-06-25 21:01:27

    做项目时候需要设定一个状态值为全局可以使用。所以使用vuex 在index.js当中state内设定属性。 state: { // 切换播放按钮 playPause: true }, mutations: { updataPlayPause: function (state) { state.playPause = !state.playPause } }   而

  • 查漏补缺——说说addEventListener和removeEventListener的参数?2022-06-23 21:01:25

    问题 如题所示 答案 js添加事件和移除事件:addEventListener()与removeEventListener() 源码如下: watch:{ show(value) { if (value) { document.body.addEventListener('click', this.close) } else {

  • vue + elementUI 表单重置两种方法2022-06-22 14:32:23

    一、添加 prop 清空验证和内容<el-form-item label="排序" prop="orders"> <el-input v-model="ruleForm.orders"></el-form-item>在 <el-form ref="ruleFormRef ">添加 ref属性,然后使用this.refs["ruleFormRef"].res

  • div 的拖动且不影响 原有页面说我点击交互2022-06-22 10:35:33

    HTML:  <div    class="kongtiaojifang" ref="kongtiao" @mousedown="mouseDownHandleelse($event)" @mouseup="mouseUpHandleelse($event)" > </div>   js : // 拖动div         mouseDownHandleelse(event) {          

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有