![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
vue
~那一刻~
付出就有收获
展开
-
webpack配置代理及cookie
const cookie = ''; //cookie值const RefererPath = 'index.html'module.exports = { dev: { proxyTable: { '/api':{ //前缀 target: url, //目标地址 changeOrigin:true, //是否允许跨域 onProxyReq: function(proxyReq, req, res) {原创 2021-01-05 11:26:20 · 1186 阅读 · 0 评论 -
手写vue双向数据绑定原理
class Vue { constructor(options) { this.$el = options.el; this.$data = options.data; let computed = options.computed; let methods = options.methods // 这个跟元素是否存在 if (this.$el) { // 把数据全部转化成用Ob翻译 2021-01-03 22:37:16 · 225 阅读 · 0 评论 -
computed,watch区别及一起搭配使用
computed定义:依赖其它属性值,并且 computed 的值有缓存,只有它依赖的属性值发生改变,下一次获取 computed 的值时才会重新计算 computed 的值watch定义:更多的是「观察」的作用,无缓存性,类似于某些数据的监听回调,每当监听的数据变化时都会执行回调进行后续操作使用场景建议:需要缓存用computed需要异步操作用watchcomputed,watch一起使用...原创 2020-12-28 14:50:16 · 556 阅读 · 1 评论 -
mixin介绍
Mixin概述混入(mixin)提供了一种非常灵活的方式,来分发 Vue 组件中的可复用功能。一个混入对象可以包含任意组件选项。当组件使用混入对象时,所有混入对象的选项将被“混合”进入该组件本身的选项例子定义一个混入对象export const myMixin = { data() { return { num: 1 } }, created() { this.func_one(); he原创 2020-08-09 16:33:34 · 10959 阅读 · 0 评论 -
前端实现模糊查询
效果图需求当input值为空时显示所有数据当input有值时,添加回车事件模糊查询思路input添加一个回车事件,用数组es6方法filter过滤数组input添加一个input事件,实时监听input的值,为空时数据显示全部<template> <div class="approvalListBox"> <div class="searchBox"> <!-- 添加回车事件,input事件 -->原创 2020-11-11 16:36:47 · 5641 阅读 · 2 评论 -
word转html格式
1.另存为选择html格式保存到桌面2.用记事本打开刚刚保存的,另存为选择编码格式utf-8原创 2020-11-09 16:50:30 · 373 阅读 · 0 评论 -
vue跳转到html文件
把.hmtl放到static文件夹目录下通过location.href跳转原创 2020-11-09 16:49:40 · 2366 阅读 · 1 评论 -
封装缓存
1.新建一个js文件const utils = {};utils.setItem = function (key, val) { localStorage.setItem(key, JSON.stringify(val));};utils.getItem = function (key) { return JSON.parse(localStorage.getItem(key));};utils.removeItem = function (key) { local原创 2020-11-06 11:28:50 · 176 阅读 · 0 评论 -
vue动画使用
<template> <transition name="approvalList-fadein"> <div class="conApprovalBox" v-if="isShow"> <div class="opac"></div> <div class="userInfoBox"> <div class="userInfo"> <div cl原创 2020-11-06 09:28:44 · 167 阅读 · 0 评论