vue-cli指定版本安装
摘要:安装新的版本前,需要先把之前安装的版本卸载掉。vue卸载:npm uninstall vue-cli -g(3.0以下版本卸载)npm uninstall -g @vue/cli(3.0以上版本卸载)vue安装:npm install -g @vue/cli (安装的是最新版)npm install
阅读全文
posted @
2023-03-03 15:25
西门夜说
阅读(536)
推荐(0)
js 判断数组对象中某个字段有无重复
摘要:let arr = [ { name: 'zhangsan', id: '1001' }, { name: 'lisi', id: '1001' } ] // 判断id是否重复// 返回一个id的数组const newArr = arr.map(item => item.id ) // Set类似于
阅读全文
posted @
2021-06-23 16:24
西门夜说
阅读(2430)
推荐(0)
vue中使用vue-giant-tree
摘要:1.安装 vue-giant-tree npm i vue-giant-tree --save 2.在需要ztree树的页面引入 import tree from "vue-giant-tree"; 3.注册ztree components: { tree }, 4.在data中配置ztree //
阅读全文
posted @
2020-10-13 00:09
西门夜说
阅读(7272)
推荐(1)
vue 中使用svg
摘要:1.安装依赖 npm install svg-sprite-loader --save-dev 2.在src/components下新建文件夹及文件SvgIcon/index.vue <template> <svg :class="svgClass" aria-hidden="true" v-on=
阅读全文
posted @
2020-10-08 16:46
西门夜说
阅读(1454)
推荐(1)
elementui v-for el-menu 任意多级菜单
摘要:父组件:Nav.vue <template> <div> <el-menu default-active="1" background-color="#545c64" text-color="#fff" active-text-color="#ffd04b"> <!-- 引入组件 --> <Menu
阅读全文
posted @
2020-09-29 11:17
西门夜说
阅读(4785)
推荐(0)
elementui table表格 多对一设计 合并
摘要:<template> <BoxCorner> <el-container style="border: 1px none #04c6ee;height: 100%"> <el-main> <el-container style="border: 1px none #04c6ee;height: 10
阅读全文
posted @
2020-06-28 17:32
西门夜说
阅读(2252)
推荐(0)
v-for 点击按钮样式切换 切换表格
摘要:<template> <div > <el-container v-if="mineSurveyAndGovernStatus.mineSurveyStatus '历史遗留矿山'&&mineSurveyAndGovernStatus.governState '已治理(含自然修复)'"> <el-as
阅读全文
posted @
2020-06-18 11:34
西门夜说
阅读(412)
推荐(0)
elementui Form表单校验 侧边栏 Notification提示校验信息
摘要:<el-main style="overflow-y: auto;text-align: -webkit-center"> <div class="base-info-form" style="padding:20px;width:50%"> <el-form @validate="validate
阅读全文
posted @
2020-05-08 15:27
西门夜说
阅读(2441)
推荐(1)
vue通过判断动态显示样式
摘要:<el-table-column align="center" prop="submitState" label="报送状态" > <template slot-scope="scope"> <div :style="scope.row.submitState '已上报'?'color:#01b79
阅读全文
posted @
2020-04-02 14:31
西门夜说
阅读(5820)
推荐(0)
elementui Tree 树形控件增删改查
摘要:数据表结构: 前端代码 axios.js import axios from 'axios'; import Qs from 'qs'; import {Message} from 'element-ui'; axios.defaults.baseURL = "/"; // 设置请求超时时间 axi
阅读全文
posted @
2020-02-02 22:25
西门夜说
阅读(15362)
推荐(1)
vue ref获取元素设置样式
摘要:<div ref="indexChart" ><div> this.$refs.indexChart.$el.style.display='none'
阅读全文
posted @
2020-01-15 15:45
西门夜说
阅读(15794)
推荐(0)
vue 点击动态切换样式
摘要:<template> <div> <el-row> <el-col :span="8" class="el-col" :class="{'BorderActive':isActive 1}" > <div > <img src="/img/map/basemap.png" @click="selec
阅读全文
posted @
2020-01-14 17:56
西门夜说
阅读(1739)
推荐(0)
vue 页面点击图标动态切换
摘要:<template> <el-container class="box-card"> <el-aside style="width: 16%;background-color: #ffffff;border: solid 2px #eeeeee"> <div class="content-heade
阅读全文
posted @
2020-01-09 14:10
西门夜说
阅读(3474)
推荐(0)
vue axios的封装
摘要:在根目录上创建一个vue.config.js文件 const path = require("path"); const resolve = function(dir) { return path.join(__dirname, dir); }; module.exports = { publicP
阅读全文
posted @
2019-12-29 04:31
西门夜说
阅读(418)
推荐(0)
vue input框type=number 保留两位小数自定义组件
摘要:第一步:自定义组件MyNumberInput.vue<template> <input class="numberInput" type="number" :placeholder="placeholder" v-model="inputData" @keydown="keydownFn" /></
阅读全文
posted @
2019-11-20 16:54
西门夜说
阅读(4244)
推荐(0)
elementui表格表头合并
摘要:第一步:用多级表头,该删删 该减减 第二步:使用header-cell-style属性
阅读全文
posted @
2019-11-18 10:51
西门夜说
阅读(6197)
推荐(1)
computed和watch运用场景
摘要:computed:通过属性计算而得来的属性 1、computed内部的函数在调用时不加()。 2、computed是依赖vm中data的属性变化而变化的,也就是说,当data中的属性发生改变的时候,当前函数才会执行,data中的属性没有改变的时候,当前函数不会执行。 3、computed中的函数必须
阅读全文
posted @
2019-11-08 15:08
西门夜说
阅读(453)
推荐(0)
assets和static
摘要:相同点: assets和static两个都是存放静态资源文件。项目中所需要的资源文件图片,字体图标,样式文件等都可以放在这两个文件下. 不相同点: assets中存放的静态资源文件在项目打包时,也就是运行npm run build时会将assets中放置的静态资源文件进行打包上传,所谓打包简单点可以
阅读全文
posted @
2019-09-26 16:43
西门夜说
阅读(256)
推荐(0)