![](https://img-blog.csdnimg.cn/20201014180756724.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
vue
叶梓啊
入职啦,短期不更新了,有需要请评论留言
展开
-
vue prettier报错Delete
控制台报错信息如下F:\aaaaa\dice-front\store\tag.js 1:30 error Delete `␍` prettier/prettier 2:11 error Delete `␍` prettier/prettier 3:3 error Delete `␍` prettier/prettier 4:1 error Delete `␍` prettier/prettier 5:27 error Delete `␍` pretti原创 2021-12-18 22:05:24 · 1048 阅读 · 0 评论 -
springboot-websocket
1.websocket使用原创 2021-09-03 10:05:51 · 833 阅读 · 3 评论 -
vue打包部署后,前端页面刷新后丢失
原因: 路由配置里模式不正确找到router文件夹,里边文件中,找到mode: 'history'把这行注释掉原创 2021-05-17 15:56:56 · 1016 阅读 · 0 评论 -
vue使用外部js
vue 引用外部js外部js中export function getColor(index) { const clolrTable = ['#398af7', '#ff9f10', '#15ce7d'] return clolrTable[index % clolrTable.length] //取余,防止超长}vue中import {getColor} from '@/utils/js' //注意引用路径//使用this.color = getColor(0).原创 2021-03-21 14:42:56 · 973 阅读 · 0 评论 -
vue.js构造树
树形结构构造循环方法,判断有children就调用自己//格式化树结构 formatTree(data, form) { const haveChildren = Array.isArray(data.children) && data.children.length > 0 const obj = {} Object.keys(form).map(key => { const oldKey = form[`${ke原创 2021-03-16 15:10:32 · 216 阅读 · 0 评论 -
vue拖拽div
下载安装 yarn add vuedraggable参考https://sortablejs.github.io/Vue.Draggable/#/clonehttp://www.ptbird.cn/vue-draggable-dragging.html使用import vuedraggable from 'vuedraggable';页面<template> <div class="test-vuedraggable-box"> <div原创 2021-03-16 14:44:48 · 269 阅读 · 0 评论 -
vue调用子组件里的方法
使用子组件内部的方法<!--给组件绑上一个ref属性,例如tree--><Tree :data="data2" ref="tree" show-checkbox></Tree>//然后就可以使用组件里的方法获取返回值console.log(this.$refs.tree.getCheckedNodes())this.$refs.tree.show()组件里的方法:getCheckedNodes(){return “123”}show(){thi原创 2021-03-16 14:41:09 · 1550 阅读 · 0 评论 -
vue url传参,获取url中的参数
url参数//在生命周期中获取,在方法中写法相同create(){ this.$router.currentRoute.query.id //这个不用 this.$route.query.id //用这个获取url上的id}url: www.baidu.com/?id=1原创 2021-03-16 14:38:24 · 1843 阅读 · 0 评论 -
强迫症讨厌的vue警告,[Vue warn]Prop being mutated: “visible“
写VUE组件的时候,用到Modal经常会有这个警告,强迫症看的不舒服:[Vue warn]: Avoid mutating a prop directly since the value will be overwritten whenever the parent component re-renders. Instead, use a data or computed property based on the prop's value. Prop being mutated: "visible"原原创 2021-03-08 15:35:37 · 6477 阅读 · 3 评论 -
弹出框Modal子组件,调用父组件方法关闭
本人使用.sync修饰符, // this.$emit('update:visible-a',false); //无效 this.$emit('update:visibleA',false); //有效 <modal:visible-a.sync="bool"></modal>示例visibleChange(val) { if (!val) { this.close(); } else {原创 2021-02-03 15:53:15 · 1443 阅读 · 0 评论 -
vue @click失效?@click.native
今天写vue用的iview的组件,Tag。但是,@click事件不好使了,然后,对应的解决方案是:用@click.native<Tag color=“warning” v-else-if=“row.endStatus==4” @click.native=“lookDetail(row)”>一个标签1,给vue组件绑定事件时候,加上native ,否则会认为监听的是来自Item组件自定义的事件2,等同于在子组件中: 子组件内部处理click事件然后向外发送click事件:$emit(“cl原创 2021-01-11 21:53:06 · 1637 阅读 · 0 评论 -
iview非空验证,iview自定义验证,iview表单验证
iview非空判断先在data 的return里写一个规则data() { return { rules: { userIds: [{ required: true, message: "请选择用户", trigger: "blur" }], }, } }在页面的form上绑定这个规则<Form ref="formValidate" :label-width="100" :rule=原创 2020-11-30 21:56:34 · 676 阅读 · 0 评论 -
vuex简单使用,全局注册数据,数组传递
首先需要有cli脚手架,初始化项目,再安装vuexnpm install --save vuex在src下创建store文件夹,在里边创建index.js文件index中import Vue from 'vue'import Vuex from 'vuex'Vue.use(Vuex)const state = { listItemsOut: ["zzzzzzzz", "yyy...原创 2019-03-01 10:08:21 · 2985 阅读 · 0 评论 -
新环境,yarn报错无法运行脚本
错误:yarn : 无法加载文件 C:\Program Files\nodejs\yarn.ps1,因为在此系统上禁止运行脚本。有关详细信息,请参阅 https:/go.microsoft.com/fwlink/?LinkID=135 170 中的 about_Execution_Policies。所在位置 行:1 字符: 1解决方案:1.win+X键,使用管理员身份运行power shell2.输入命令:set-executionpolicy remotesigned3.输入Y,回车,解决原创 2020-12-24 11:25:16 · 474 阅读 · 0 评论 -
iview menu on-select事件
iview menu on-select事件在menu上使用@on-select事件,MenuItem的name绑定成需要用的值,我绑了id,然后在绑定的事件里去操作。<Menu class="left-menu" :open-names="['audit']" @on-select="select"> <Submenu name="audit" class="left-content"> <template slot="title" class="原创 2020-12-01 14:15:46 · 2539 阅读 · 2 评论