![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
VUE
jasonjkj
初入前端 多多指教
展开
-
点击元素外侧 clickoutside
基本原理:事件的冒泡 和捕获 ,你只要不阻止冒泡 ,事件就会传递到documentexport const clickoutside = { // 初始化指令 bind(el, binding, vnode) { function documentHandler(domEvent) { debugger //js的contains方法用来查看dom元素的包含关系, //如果 点击的触发元素 ..原创 2022-02-25 14:26:11 · 758 阅读 · 0 评论 -
element源码修改,为依赖打补丁
文章参考链接:https://juejin.im/post/5ec381215188256d776342cd ...1.使用插件 使用patch-package来修改node_modules参考文章:https://www.jianshu.com/p/ebcbac8d952d问题:1.使用这种写法,没办法编译node_module 下面的element 包,没办法直接安装依赖 执行编译2. 你直接去改webpack 打包后的,最终文件,看不懂代码3. 直接 替换lib...原创 2020-09-04 19:42:27 · 1136 阅读 · 0 评论 -
vue的打包
1. 修改config文件夹下 index.js文件assetsPublicPath: './',注意:需要 修改两处 ...2.vue-router mode: 'history', 使用history 是需要后台的支持的如果,没有后台 直接 mode:hash ,或者不写这个选项(默认就是hash的模式)3.执行命令: mode: 'history', cnpm ru...原创 2018-06-17 15:20:16 · 501 阅读 · 0 评论 -
vueX的使用
1../src/store 新建store文件夹 ,store文件夹下 index.js 入口文件:import Vue from 'vue';import Vuex from 'vuex';Vue.use(Vuex);//导入你需要的模块import cart from './modules/cart.js'export default new Vuex.Store({ ...原创 2018-07-02 20:56:15 · 115 阅读 · 0 评论 -
vue 插件的使用:
vue的插件: 感觉就是一个组件而已: 1.component/Loading文件夹 index.js 入口文件import LoadingComponent from './Loading.vue'const Loading={ install:function (Vue) { Vue.component('Loading',Loadin...原创 2018-07-02 23:13:00 · 255 阅读 · 0 评论 -
使用vue构建一个项目-1
一个vue 的项目前期配置:1.使用vue-cli3 直接构建项目 ,配置less babel ...2.vue-cli3的一些配置, a.新建一个vue.config.js 的文件 (类似于 webpack.js ) 1.vue.config.js模板的写法: 参考 :https://blog.csdn.net/qq...原创 2019-01-31 11:52:20 · 365 阅读 · 0 评论