- 博客(19)
- 收藏
- 关注
原创 element-ui中在el-table插入插槽中传入索引index
<el-table-column label="操作"> <template slot-scope="scope"> <el-button type="primary" icon="el-icon-edit" size="mini"></el-button> <el-button type="danger" icon="el-icon-delete" size="mini"></el-button>.
2021-04-14 19:26:45 2393
原创 获取索引值
methods: { onChange(index){ get('/posts').then(res=>{ this.activeKey=index this.position=res.data[this.activeKey].message console.log(res.data[this.activeKey].message) }) } } d
2021-04-04 20:10:57 343
原创 element表单渲染中用户的状态(接着上一个的)
<template> <div class="home"> <el-table :data="tableData" border style="width: 100%"> <el-table-column prop="id" label="序号" width="180"></el-table-column> <el-table-column prop="title" label="内容" width="18
2021-03-19 17:31:19 149
原创 使用element对表单进行渲染
<template> <div class="home"> <el-table :data="tableData" border style="width: 100%"> <el-table-column prop="id" label="序号" width="180"></el-table-column> <el-table-column prop="title" label="内容" width="1.
2021-03-19 14:02:43 285
原创 axios拦截器的顺序
顺序:请求拦截,请求,响应拦截,响应,顺序不能颠倒// Add a request interceptoraxios.interceptors.request.use(function (config) { // Do something before request is sent console.log('request is sent') return config; }, function (error) { // Do something with requ
2021-03-16 00:54:28 872
原创 利用json-server模拟mock数据。
在github上面搜索json-server,按照下面的方法做就可以了,要注意的是db.json文件要建立在和package.json文件在同一目录下的同级文件
2021-03-13 00:14:29 114
原创 嵌套路由的使用
router下的index.js中import Vue from 'vue'import VueRouter from 'vue-router'import Home from '../views/Home.vue'import page1 from '../views/page1.vue'import page2 from '../views/page2.vue'import page3 from '../views/page3.vue'import page4 from '../compo
2021-03-11 22:16:46 92
原创 axios封装的思想,解决多个链接后期维护问题,适用于大型项目
首先来看一下普通的axios网络请求方式1.使用get请求和post请求<div> <button @click="getHandle">发送get请求</button> <button @click="postHandle">发送post请求</button></div>export default { name: 'Home', components: { }, // data(){
2021-03-10 23:15:33 199
原创 Vue-Cl3引入axios网络请求的两种方式
在终端:npm install axios --save在main.js中:import axios from 'axios'Vue.prototype.$axios=axiosmethods:{ getdata(){ this.$axios.get("https://jsonplaceholder.typicode.com/users") .then(res=>{ console.log(res) }) }
2021-03-10 00:43:26 123
转载 Vue-Cl3引入axios网络请求的两种方式
安装npm install --save axios vue-axios引入main.js中:import axios from ‘axios’;import VueAxios from ‘vue-axios’;Vue.use(VueAxios, axios);组件中使用created(){this.axios({url:’‘http://jsonplaceholder.typicode.com/posts’ , //请求地址methods:‘GET’ , //请求方式params:
2021-03-10 00:35:03 134
转载 2021-03-07
git 配置 SSH密钥,解决失败问题 为什么配置SSH git使用https协议,每次pull、push都要输入密码,相当烦。使用ssh密钥可以省去每次都输密码。多人协作的需要,区分权限及身份。配置步骤 前提:已安装git,很简单,不多说。 本地创建SSH key。使用GitHub的注册邮箱ssh-keygen -t rsa -C "your_email@youremail.com"第一...
2021-03-07 20:14:23 328
原创 如何将本地项目导入到Github上面
首先在vsccode创建一个Vue-CL3项目vue create '项目名称' / vue create shoppingmall在Github上面创建一个空白项目,复制如下代码输入前两行代码,方可连接到GitHub,第三个代码在连接之后再次把数据推送过去,首次连接只需输入前两行代码,地址为上面复制的链接。打开GitHub,刷新页面,当看到如下页面时,说明建立连接成功。...
2021-03-07 19:28:24 217 1
原创 2021-03-07
我们在github创建项目后,本地使用Git克隆代码需要在github配置密钥。如果没有重做系统的话,每台电脑只需配置一次,一般在刚去公司的时候配置,否则话无法使用github拉取和上传项目代码。Git安装https://www.git-scm.com安装过程全都是默认的,next到最后,install安装git version 查看是否安装成功此时表示已经安装成功ssh-keygen -t rsa -C "youremail@youremail.com"然后一直点回车在指定文件夹
2021-03-07 18:00:02 84
原创 原生js代码实现图片切换功能
<!DOCTYPE html><html> <head> <meta charset="UTF-8"> <style type="text/css"> *{margin: 0; padding: 0;} #outer{ width: 500px; text-align: center; padding: 20px;margin: 50px auto;background-color: yellow;} </s
2021-03-03 15:35:25 239 1
原创 有关冒泡问题的解决方案(原生js代码)
取消冒泡:event.cancelBubble=true<script type="text/javascript"> var s1=document.getElementById("s1") s1.onclick=function(event){ event.cancelBubble=true alert("span") } var box=document.getElementById("box") box.onclick=function(eve.
2021-03-03 15:28:52 195 1
原创 多彩表格
表格的基本格式和css样式 <colgroup> <col class="style1"> <col class="style2"> <col class="style3"> <col class="style4"> <col class="style5"> <col class="st
2021-03-02 21:15:39 64
原创 表格
<table> <caption>IE浏览器发展大事记</caption> <colgroup> <col class="style2"> <col class="style3"> <col class="style4"> </colgroup> <tr class="style1"> <th>版本</t
2021-03-02 20:52:49 108 1
原创 人大代表登陆界面
<style> .style1{border: none;} body{background: url(bg1.jpg)no-repeat;padding: 0%;margin: 0%;} h1{text-align: center; letter-spacing: 20px; color: #ffffff;-webkit-text-fill-color: orangered;} div{background-image: url(2.p.
2021-03-02 20:41:25 102
原创 前端基础
html css js 基础<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <style type="text/css"> .style1{ margin-top: 0%; f
2021-03-02 20:30:17 69
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人