【Vue使用NProgress】教程文章相关的互联网学习教程文章

Vue3使用vue3-video-player【图】

地址:https://github.com/LarchLiu/vue3-video-player这个上面有例子,可以参考。如果出现问题: npm install @cloudgeek/playcore-hls --save效果: 原文:https://www.cnblogs.com/qinghuaL/p/14772806.html

vue 使用防抖和节流【代码】

// 防抖 export const debounce= (func, wait) => {var timeout;returnfunction () {var context = this;var args = arguments;clearTimeout(timeout)timeout = setTimeout(function(){func.apply(context, args)}, wait);} };// 节流 export const throttle = (fn, wait) => {let canRun = true; // 通过闭包保存一个标记returnfunction () {if (!canRun) return; // 在函数开头判断标记是否为true,不为true则returncanRun = fal...

vue 使用element 菜单与tab页联动【代码】

没找到比较好的方法 自己写了一个<template><div class="ucen-menubar menu"><div class="sider"><el-menu class="el-menu-vertical-demo siderBar" background-color="#2A2E3C" text-color="#fff"><el-submenu :index="‘‘+index" v-for="(item,index) in menus" :key="index" :class="item.class"><template slot="title"><span class="titleIcon"></span><span>{{item.menuName}}</span></template><el-menu-item :index="inde...

vue使用easyExcle 导出excle文件【代码】【图】

添加easyExcle依赖 <!--导出excel--><dependency><groupId>com.alibaba</groupId><artifactId>easyexcel</artifactId><version>1.1.2-beta5</version></dependency>// 或者!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! <dependency><groupId>com.alibaba</groupId><artifactId>easyexcel</artifactId><version>2.2.8</version></dependency> 1.首先是vue前端,写好导出方法// 导出设备维修表 outputWord () {this.$axios.post(‘/fac...

解决 vue 使用 element 时报错ERROR in ./node_modules/element-ui/lib/theme-chalk/fonts/element-icons.ttf【代码】

在 webpack.config.js 中加入这个依赖{test: /\.(eot|svg|ttf|woff|woff2)(\?\S*)?$/,loader: ‘file-loader‘ } 原文:https://www.cnblogs.com/carriezhao/p/11791204.html

Vue使用NProgress【代码】

NProgress是页面跳转是出现在浏览器顶部的进度条官网:http://ricostacruz.com/nprogress/github:https://github.com/rstacruz/nprogress 安装 $ npm install --save nprogress或者 $ yarn add nprogress用法NProgress.start() 显示进度条NProgress.done() 隐藏进度条使用//导入 import NProgress from ‘nprogress‘import ‘nprogress/nprogress.css‘ router.beforeEach((to, from, next) => { NProgress.start() next() }) r...

vue 使用<a>标签 锚记后刷新页面 找不到页面【代码】

使用<a>标签锚记 会在URL上添加路径 导致刷新页面时无法找到 正确的页面解决:<a @click="Top"></a>methods:{Top (){document.querySelector("#id").scrollIntoView(true);}}document.querySelector("要去的地方的id").scrollIntoView(true); 标签 锚记后刷新页面 找不到页面' ref='nofollow'>vue 使用标签 锚记后刷新页面 找不到页面原文:https://www.cnblogs.com/aknife/p/12091721.html

Vue 使用数组和对象控制Class【代码】

直接上代码:<!doctype html><html lang="en"><head><meta charset="UTF-8"><title>vue.js 使用数组和对象控制Class </title><script src="vue.js"></script><script src="node_modules/axios/dist/axios.js"></script><script src="node_modules/lodash/lodash.js"></script></head><body><style>.red{color:red;}.font{font-size: 200px;}</style><div id="ask"><!--vue不能控制body和html的标签--><h1 :class="object">简单</h1>...

vue使用Google Map

参考https://developers.google.cn/maps/documentation/javascript/get-api-keyvue使用google地图不FQ使用google搜索原文:https://www.cnblogs.com/Jamie1032797633/p/11267420.html

vue使用domtoimage实现移动端H5页面截图【代码】【图】

dom-to-image是一个可以将任意DOM节点转换为用JavaScript编写的矢量(SVG)或光栅(PNG或JPEG)图像的库。 它基于Paul Bakaus的domvas并且已被完全重写,修复了一些错误并添加了一些新功能(如Web字体和图像支持)。github:点击查看线上demo:点击查看npm安装和引用npm install dom-to-imageimport domtoimage from ‘dom-to-image‘;domtoimage方法和属性domtoimage主要的方法有:domtoimage.toPng(...);将节点转化为png格式的图...

Vue使用watch监听数组或对象的总结【代码】

一、监听数组  1.watch能监听到数组的push的改变,例如data () {return {demo: [1,2]} }, mounted (){    window.myVue = this },watch: {demo(val){console.log(val)} },myVue.demo.push(3) //[1,2,3]  2.watch 不能检测以下变动的数组:当你利用索引直接设置一个项时,例如:myVue.demo[1] = 5当你修改数组的长度时,例如:myVue.demo.length = 2  这时候你可以删除原有键,再 $set 一个新的,这样就可以触发watchmy...

Vuex 基本使用 (附 todolist_demo)【代码】【图】

vuex 概述vuex 是实现组件全局状态(数据) 管理的一种机制, 可以方便的实现组件之间的共享优点 :能够在 vuex 中集中管理共享的数据, 易于开发和后期维护能够高效地实现组件之间的数据共享 , 提高开发效率存储在 vuex 中的数据都是响应式的 , 能够实时保持数据与页面的同步什么样的数据适合存储到 vuex 中一般情况下 , 只有组件之间共享的数据 , 才有必要存储到 vuex 中 ; 对于组件中私有数据 , 依旧存在组件自身的 data 中即可vuex ...

vue使用install函数把组件做成插件方便全局调用【代码】

在vue项目中,我们可以自定义组件,像element-ui一样使用Vue.use()方法来使用,具体实现方法:1.首先新建一个Cmponent.vue文件// Cmponent.vue <template><div>我是组件</div> </template><script>export default {} </script><style scoped>div{font-size:40px;color:#fbb;text-align:center;} </style>2.其次在同一目录下建立index.js文件,在这个文件中使用install方法来全局注册该组件import component from ‘./Cmponent.vue...

mpvue使用vant-weapp【代码】

1.npm install vant-weapp 2.在webpack.base.conf.js加参数new CopyWebpackPlugin([{from: resolve(‘node_modules/vant-weapp/dist‘),to: resolve(‘dist/wx/vant-weapp/dist‘),ignore: [‘.*‘]}]) 3.在页面json引入控件"usingComponents": {"van-button": "../../vant-weapp/dist/button/index","van-cell-group": "../../vant-weapp/dist/cell-group/index","van-cell": "../../vant-weapp/dist/cell/index","van-icon": ".....

vue 使用mqtt即使通讯协议【代码】

MQTT安装npm install mqtt或<script src="./static/mqtt/mqttws31.js"></script> 自行下载引入资源 使用本地引入的方式:<template><div><p></p></div></template><script> import { uuid } from "vue-uuid"; export default {name: "MqttConnect",props: {},data() {return {config: {},reconnectTimeout: 2000,mqtt: null,msg: "",topic: "mqtt", // 订阅的主题 };},watch: {},mounted() {this.config = {host: "192.168.1.10...