随笔分类 -  Vue

摘要:<template> <div id="app"> <el-menu :default-active="activeIndex2" class="el-menu-demo" mode="horizontal" background-color="#545c64" text-color="#fff" 阅读全文
posted @ 2022-07-07 11:23 海乐学习 阅读(129) 评论(0) 推荐(0) 编辑
摘要:比如 var new_id=this.tableData[this.tableData.length-1].id; 这样取到的 数据集中 最后一行的 id 值 为 120 new_id= new_id + 1; 如果这样写的话 得到的 new_id 为 1201 显然这不是我们想要的。 首先需要 将 阅读全文
posted @ 2022-07-07 11:22 海乐学习 阅读(744) 评论(0) 推荐(0) 编辑
摘要:1. 定义一个el-dialog,设置“:title” 注意title前面需要加冒号 <!-- 新增 编辑 窗口 --> <el-dialog :title="dialogTitle" :visible.sync="dialogVisible"> </el-dialog> 2. 初始化变量( 定义 阅读全文
posted @ 2022-07-07 11:22 海乐学习 阅读(2595) 评论(0) 推荐(0) 编辑
摘要:var jsonArrStr = '[{"id":"100","name":"刘加料", "phone1":"111112222", "phone2": "12877777","address": "中国", "remark": "备注2", "operation": ""},{"id":& 阅读全文
posted @ 2022-07-07 11:13 海乐学习 阅读(1426) 评论(0) 推荐(0) 编辑
摘要:前端的 json对象数组 tableData: [ { id: '100', classify: '分类一', name: '刘加料', phone1: '1381111111', phone2: '12877777', address: '中国', remark: '备注2', operation 阅读全文
posted @ 2022-07-07 11:12 海乐学习 阅读(373) 评论(0) 推荐(0) 编辑
摘要:this.tableData = undefined; this.tableData = new Array(); 直接将 this.tableData 数组重新赋值为undefined 这样就能实现数组 和 el-table 清空了。 当然这是在后面 this.tableData 没有再用到的情况 阅读全文
posted @ 2022-07-07 11:11 海乐学习 阅读(1438) 评论(0) 推荐(0) 编辑
摘要:Get onSelect() { var url = 'http://192.168.1.143:5011/httpCli?action=query'+"&name="+this.selectForm.name+"&phone="+this.selectForm.phone ; this.$http 阅读全文
posted @ 2022-07-07 11:11 海乐学习 阅读(247) 评论(0) 推荐(0) 编辑
摘要:devServer 实现纯前端配置代理解决axios跨域 注:devServer 只在 开发环境 有效 如果实现 编译后跨域 可采用 nginx代理的方法 可参考:https://www.cnblogs.com/hailexuexi/p/14934166.html 一、在 vue.config.js 阅读全文
posted @ 2021-06-26 14:40 海乐学习 阅读(54) 评论(0) 推荐(0) 编辑
摘要:项目 要求 在windows 上 安装 nginx 实现 代理连接sinaApi 一.下载 nginx-1.18.0.zip 安装nginx 二. 改nginx的config 配置文件目录 C:\nginx-1.18.0\conf 1. 将nginx的端口改为 另外的端口, 不然会和本地的 web冲 阅读全文
posted @ 2021-06-26 14:19 海乐学习 阅读(80) 评论(0) 推荐(0) 编辑
摘要:<!-- 通讯录页 --> <template> <div class="page-item page-callrecords"> <div class="page-content" ref="pageTab"> <div class="page-tab"> <el-form :model="sel 阅读全文
posted @ 2021-06-24 14:08 海乐学习 阅读(2351) 评论(0) 推荐(0) 编辑
摘要:效果: 代码: <template> <div id="table"> <el-row> <el-col :span="24"> <div class="table-grid-content"> <el-button type="primary" @click="addRow()" >新增</el- 阅读全文
posted @ 2021-06-22 22:12 海乐学习 阅读(123) 评论(0) 推荐(0) 编辑
摘要:一、components文件夹下,新建一个名为 addressGridView文件夹 二、将已有好用的页面 AddressList.scss 和 AddressList.vue 这两个文件到 addressGridView文件夹下 并改名为 AddressGridView.scss 和 Addres 阅读全文
posted @ 2021-06-22 16:15 海乐学习 阅读(133) 评论(0) 推荐(0) 编辑
摘要:在Vue项目中遇到动态列表中的某些字的颜色要与其内容的变化而变化 如图 根据 用户是否 注册来 动态改变 其文字的颜色 Html <el-col :span="8" v-for="(dataItem, index) in pageContentData" :key="index"> <div cla 阅读全文
posted @ 2021-02-22 14:17 海乐学习 阅读(492) 评论(0) 推荐(0) 编辑
摘要:vue.config.js // Axios跨域请求 devServer:{ port:4000,//vue网页访问的端口 host:"127.0.0.1",//vue网页访问的地址 https:false, open:false, proxy: { '/sina': { //为用于替换的的标识字符 阅读全文
posted @ 2021-01-19 22:58 海乐学习 阅读(2558) 评论(0) 推荐(0) 编辑
摘要:一、定义 全局变量 注:如果不在 store目录下的 index.js 定义 则 在其它 ***.vue 页面 代码中赋值,其它页面的这个全局变量,是不会变化的。 store目录下的 index.js export default new Vuex.Store({ state: { current_ 阅读全文
posted @ 2021-01-13 20:32 海乐学习 阅读(35164) 评论(0) 推荐(0) 编辑
摘要:1.安装:npm install axios --save-dev 2.main.js中导入 import axios from 'axios'; Vue.prototype.$axios=axios; axios.defaults.baseURL ='http://localhost/VueApi 阅读全文
posted @ 2021-01-11 12:18 海乐学习 阅读(5301) 评论(0) 推荐(0) 编辑
摘要:在vue开发中遇到 加载json配置文件,而且这个配置文件不应被打包 这就需要在 public 目录下 创建static目录 。 在static目录下 创建 config.json 文件 ,文件内容如下: { "apiUrl": "http://localhost/VueApi" } 读取方法分两种 阅读全文
posted @ 2021-01-07 22:48 海乐学习 阅读(4079) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示