
VUE
[email protected]
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
VUE3多根标签ESLINT报错处理
VUE3多根标签ESLINT报错处理原创 2023-01-01 15:56:00 · 436 阅读 · 0 评论 -
vue页面关闭beforeunload的使用
浏览器关闭前事件beforeunload原创 2022-05-13 16:53:59 · 1036 阅读 · 0 评论 -
VUE3 setup学习记录
<script lang="ts"> import {watchEffect, readonly, h, ref, defineComponent, toRefs, onMounted, watch,computed,reactive } from "vue"; import classes from "*.module.css"; export default defineComponent({ name: "HelloWorld", data(){ return { .原创 2021-08-10 20:05:19 · 184 阅读 · 0 评论 -
Node定时调用package.json中script命令
const child_process = require('child_process'); //stdio子进程的标准输入输出配置,'inherit':通过相应的标准输入输出流传入/传出父进程 const child = child_process.spawn('npm',['run','build'],{stdio:'inherit'}) child.on('close',code => { //执行完成 }) ...原创 2021-08-03 15:11:01 · 786 阅读 · 0 评论 -
vue render函数使用
函数式组件 // render.js export default { name: 'componentName', functinal: true, props: { options: { type: String, default: '' } }, render(h,context) { return ( <div>aaaa原创 2021-04-21 20:56:37 · 262 阅读 · 0 评论 -
VUE中如何判断组件是否存在
try { require('../aaaa.vue') //不能用import,因为不会被catch捕捉 //下面是存在的逻辑 } catch(err) { //下面是不存在的逻辑 }原创 2021-04-11 17:50:34 · 2915 阅读 · 0 评论 -
VUE页面引导插件vue-introjs使用记录
一,安装 npm i intro.js npm i vue-introjs 二,全局引入CSS import 'intro.js/introjs.css' 三,模板中使用 <template> <div v-intro="'提示文本'" v-intro-position="'top'" v-intro-tooltip-class="'tipclass'" <!--提示框CSS,注意,这里的tipclass.原创 2021-03-10 10:49:28 · 963 阅读 · 0 评论 -
前端批量引入文件荚中的文件 require.context
const example = require.context('./example',false,/\w+\.(vue)$/) example.keys().forEach(item => { console.log('example下的所有vue文件', item) // item 相对路径, console.log(example(item).default) // example(item).default 组件, }); 取出同级目录example下的(不包含 文件荚里的)所.原创 2020-11-20 17:59:29 · 555 阅读 · 0 评论 -
VUE $attrs与$listeners
主要用于上下级(非父子)组件的传参与事件调用,VUE 2.4及以上版本使用 父组件代码: <template> <div> <aa :username="username" :userage="userage" @ccc="aaaa"></aa> </div> </template> <script> import aa from "./a.vue" export default {原创 2020-11-19 17:32:52 · 132 阅读 · 0 评论 -
VUE eslint自动修复
打开vscode 首选项 --设置 把下面代码复制到用户设置区域 // 窗口失去焦点自动保存 "files.autoSave": "onFocusChange", // 编辑粘贴自动格式化 "editor.formatOnPaste": true, // 控制字体系列。 "editor.fontFamily": "pingfang,Menlo, Monaco, 'Courier New', monospace", // 字体大小 "editor.fontSize": 12, // 行高原创 2020-10-11 15:01:13 · 1139 阅读 · 0 评论 -
vue中使用iframe如何不影响路由
this.$refs.ifr.contentWindow.location.replace('http://baidu.com')原创 2020-08-17 11:48:16 · 1638 阅读 · 0 评论 -
VUE及watcher原理(简单版)
核心方法:Object.defineProperty 设计模式:数据劫持,监听者模式 上源码 <!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1"> <title></title> </head>原创 2020-05-24 18:36:04 · 644 阅读 · 0 评论 -
VUE对路由分别设置keep-alive
1,路由添加meta { path: '/flowListCard', name: 'flowListCard', component: () => import('../views/flowListCard.vue'), meta: { keepAlive: true } }, 2,APP.vue添加keep-alive组件 &...原创 2020-05-05 16:02:15 · 709 阅读 · 0 评论 -
vue render中jsx使用记录
export default { name:"rendertest", props:{ msg:{ type:String, default:'这是默认值' } }, data(){ return { name:"aaa", ...原创 2020-02-23 20:16:29 · 149 阅读 · 0 评论 -
vue import动态引入
1,动态引入组件 components: { importdata:()=>import(/* webpackChunkName: "importdata" */'./importdata.vue'), flowButtons }, 2,动态引入部分 let message = null; import(/* webpackChunkName: "elem...原创 2020-02-14 10:51:33 · 3345 阅读 · 1 评论 -
vue常用插件记录
1,上拉加载更多 vue-infinite-loading 2,本地服务启动 live-server原创 2019-11-07 10:21:45 · 132 阅读 · 0 评论 -
vue头部导航动态点击处理
1:DATA中两个变量, data: { nav:['头条1','头条2'], ins:0,//记录当前点击的INDEX }, 2: <div v-for="(item,index) in nav" :class="index == ins ? 'swiper-slide...原创 2018-11-02 11:19:46 · 594 阅读 · 0 评论 -
VUE插件制作并发布NPM
一,建立项目 1,vue init webpack-simple npmvue //npmvue为项目名称 2,src目录下,建 立LIB文件荚,并在LIB下建立INDEX.JS,这是插 件主入口,如下图: 3,插件入口,index.js就是插 件的主入口,我引入了一个测试组件component.vue,具体插件怎么制作,自行VUE官网查阅...原创 2019-08-06 14:50:50 · 197 阅读 · 0 评论 -
vue-router实现原理
两个知识点 1,window 的hashchange事件监听 2,Object的defineProperty属性 要在服务器环境中测试 index.html,代码如下: <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title></title...原创 2019-09-10 19:07:40 · 129 阅读 · 0 评论 -
VUE插件制作并发布到NPM
一,创建VUE项目(精简版) vue init webpack-simple '插件名称' 创建完毕后,创建插件,在SRC下建立lib 文件荚,在lib内建立index.js及index.vue,目录结构如下图 index.js源码如下: import aa from "./index.vue" var o = {}; o.install = function(Vue,o...原创 2019-09-29 10:47:24 · 266 阅读 · 0 评论 -
VUEX使用记录
1,安装:npm install vuex --save; 2,main.js同级目录建文件荚store 在文件荚里建index.js, 内容如下: import Vue from 'vue' import Vuex from 'vuex' Vue.use(Vuex); export default new Vuex.Store({ state:{}, mutations: ...原创 2018-07-31 12:46:01 · 221 阅读 · 0 评论