- 博客(11)
- 收藏
- 关注
原创 全局过滤器(过滤时间)
// 过滤器 Vue.filter('dateFormat',function(originVal){ const dt = new Date(originVal) // 年 const y = dt.getFullYear() // 月 getMonth 是从0开始的要加1才是正在的月 padStart(2,'0') 不足2位填充0 const m = (dt.getMonth()+1+'').padStart(2,'0') // 日 padStart(2,'0') 不足2位填充0 .
2022-03-04 09:32:43
420
原创 简单分页组件封装
<template> <div class=''> 跳转 <input type="text" v-model="pagination" @keydown.enter="changeinput" class="input"> 条 <div class="page"> <span v-for="(item,index) in allpagenum" :key="index" :class="pageNum==i.
2022-02-25 09:15:43
495
原创 简单转换时间格式
先把数据循环出来在进行转换 this.tableData.forEach((item) => { // item.createTime= new Date(parseInt(item.createTime)) .toLocaleString().split(' ')[0].replace('/', '年').replace('/', '月')+'日' item.createTime = new Date(parseInt(item.createTime
2022-02-23 08:56:35
115
原创 跨域解决方法
在vue.config.js里放入一下代码 /* * @Description: 配置文件 * @Author: hai-27 * @Date: 2020-02-07 16:23:00 * @LastEditors: hai-27 * @LastEditTime: 2021-03-03 22:32:57 */ module.exports = { lintOnSave: false, publicPath: './', devServer: { open: t...
2022-02-23 08:53:18
392
原创 axios封装
封装axios import Axios from "axios" const app=Axios.create({ // baseURL:"http://admintest.happymmall.com/manage/", // timeout:5000, }) app.interceptors.request.use( (config)=>{ return config }, (err)=>{ ret
2022-02-23 08:51:00
397
原创 获取随机色
export function getRgb() { let r = Math.floor(Math.random() * 256); let g = Math.floor(Math.random() * 256); let b = Math.floor(Math.random() * 256); // return `rgb(${r},${g},${b})`; return 'rgb('+r+','+g+','+b+')' } // Math.rand...
2022-02-21 14:29:24
180
原创 html基本知识点(看了就能懂)
一、axios下载引入 cnpm i axios --save import axios from "axios"; Vue.prototype.$axios = axios; 二、ElementUI下载 vue2 cnpm i element-ui --save import ElementUI from "element-ui"; import "element-ui/lib/theme-chalk/index.css"; Vue.use(ElementUI); vue3 npm i e
2021-12-31 09:08:33
376
原创 路由守卫的简单理解
路由守卫 全局路由守卫(路由的前置守卫)在配置路由的地方写 如下: router.beforeEach((to, from, next) => { console.log(to,from,next); if (!store.state.login && to.name != 'Home') { next('/') return } if (store.state.login && to.name == 'Home') {
2021-12-29 12:03:57
309
原创 vue基本指令和存储
1.v-if 动态的添加或删除元素 2.v-show 根据(css的display:none;block)控制显示隐藏 3.绑定事件 : v-on 简写 @ 4.绑定属性:v-bind 简写 : 5.v-model: .trim(用于自动过滤用户输入内容收尾两端的空格) .lazy (用于将 v-model 的触发方式由 input 事件触发更改为 change 事件触发) .number(用于自动将用户输入的值转换为数值类型,如无法被 parseFloat() 转换,则返回原始内容) 6.生命周期...
2021-12-27 10:27:53
165
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人