![](https://img-blog.csdnimg.cn/20201014180756923.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
笔记
AAA_86
这个作者很懒,什么都没留下…
展开
-
this.$set
当你发现你给对象加了一个属性,在控制台能打印出来,但是却没有更新到视图上时,也许这个时候就需要用到this.$set()这个方法了 Object.keys(ele).forEach(key => { // row[key] = ele[key] this.$set(row, key, ele[key]) })原创 2022-03-23 18:50:18 · 622 阅读 · 0 评论 -
vue动态获取ref方式
<div v-for="(item,index) in list" :key="index" :class=" circleAnimation === 1 ? 'ball ball'+ (index+1) : 'ball ball1'+(index+1)" ref="circle" @click="oneClick(index)"> <div>{{item.name}}</div> </div&...原创 2022-03-09 17:51:11 · 2684 阅读 · 0 评论 -
js日期转换精准到毫秒
// 精准到毫秒 getNowTime () { const date = new Date() const year = date.getFullYear() const month = date.getMonth() + 1 const day = date.getDate() const hour = date.getHours() < 10 ? '0' + date.getHours() : date.getHours() .原创 2022-02-13 14:09:23 · 2460 阅读 · 0 评论 -
css定位,v-model
定位model原创 2021-12-09 18:25:30 · 373 阅读 · 0 评论 -
vue 导出文件
把项目中的文件导入电脑本地 // 导出日志 exportClick() { // 可以自定义文件名 const fileName = null // this.$q.dialog({ // title: '', // message: '请输入文件名称', // // prompt: { // // model: fileName, // //原创 2021-09-15 21:13:44 · 563 阅读 · 0 评论 -
vue 全局路由守卫
看下面注释 ———————— router文件夹下的index.js中export default function ({store, ssrContext}) { const Router = new VueRouter({ scrollBehavior: () => ({x: 0, y: 0}), routes, // Leave these as they are and change in quasar.conf.js instead! // quasa原创 2021-09-10 20:11:55 · 173 阅读 · 0 评论 -
Echarts 折线图
<template> <div id="main" style="width: 100%;height: 220px"></div></template><script> import * as echarts from 'echarts'; export default { name: "securit", data() { return { lineData:[820, 932,原创 2021-08-31 14:09:00 · 201 阅读 · 0 评论 -
input file控件 上传本地文件及type分类
本地上传文件用 input file控件操作简单简单介绍下使用流程HTML:<input ref="file" id="file" multiple webkitdirectory type="file" accept=".txt" style="display: none" @change="importFile"/>webkitdirectory: 只上传文件夹 不上传文件夹的可以去掉,accept: 需要上传文件的类型(代码块下面有需传类型模板)JS:打开本地弹框操原创 2021-08-25 21:20:11 · 817 阅读 · 0 评论 -
登录框正则表达式
用户名:只含有汉字、数字、字母、下划线不能以下划线开头和结尾/^(?!_)(?!.*?_$)[a-zA-Z0-9_\u4e00-\u9fa5]+$/^ 与字符串开始的地方匹配(?!_) 不能以_开头(?!.*?_$) 不能以_结尾[a-zA-Z0-9_\u4e00-\u9fa5]+ 至少一个汉字、数字、字母、下划线$ 与字符串结束的地方匹配密码:含有6~10位由数字和26个英文字母混合而成的密码/^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{6原创 2021-08-04 19:40:31 · 258 阅读 · 0 评论 -
Vue使用keep-alive 达到组件之间切换,数据保持不变
1、routes.js文件中在路由中增加 meta { path: 'GenerateStation', name: 'GenerateStation', component: () => import('pages/LeftBarPages/GenerateStation'), meta:{ keepAlive:true // 通过此字段判断是否需要缓存当前组件 },2、 在控制路由跳转的原创 2021-07-12 15:25:37 · 647 阅读 · 0 评论 -
js 通过id获取数组中指定对象
this.Array[ id ].对象中属性原创 2021-07-03 15:26:55 · 2157 阅读 · 0 评论 -
js数组根据id删除多个对象
对原数组进行操作,返回改数组// 当是不是数组时 if (!Array.isArray(Array2)){ Array1.splice(Array1.findIndex(v => v.id === Array2.id), 1) } else { for (let i = Array1.length - 1; i >= 0; i--) { for (let j原创 2021-06-22 20:16:49 · 1696 阅读 · 0 评论 -
js二维数组转换一维数组
var arr1 = [[0, 1], [2, 3], [4, 5]];var arr2 = [].concat.apply([], arr1);// arr2 [0, 1, 2, 3, 4, 5]原创 2021-04-09 13:48:38 · 449 阅读 · 0 评论 -
JS随机生成ID 以及随机生成坐标
随着时间来生成不同ID // 随机生成 IDconst idStr = Date.now().toString(36)this.itemObj.id = idStrconsole.log(this.itemObj.id)每一次的id都不同----结果如图:生成不同坐标 // 随机生成坐标this.itemObj.itemPos = parseInt(Math.random() * 400, 10) + ',' + parseInt(Math.random() * 400, 10)原创 2021-03-03 15:55:05 · 1720 阅读 · 1 评论 -
针对对象属性分割去除小数点后的数字
针对对象属性这种数据的显示第一步:用split方法 用逗号先分割开 [0]是取的第一个数 [1]是取的第二个数this.graphical.itemPos.split(',')[0]this.graphical.itemPos.split(',')[1]第二步:用 parseFloat 方法把字符串数字转换为浮点数 再结合 toFixed 方法可以选择保留到小数点后几位()空的话就把小数点后的数全部清空parseFloat(this.graphical.itemPos.split(',')原创 2021-02-24 14:23:26 · 303 阅读 · 1 评论 -
js时间转换
原创 2021-01-25 18:54:37 · 96 阅读 · 0 评论 -
代码的积累
if判断的一种思路原创 2021-01-15 22:02:09 · 163 阅读 · 0 评论