script标签中的async和defer defer如果script标签设置了该属性,则浏览器会异步的下载该文件并且不会影响到后续DOM的渲染;如果有多个设置了defer的script标签存在,则会按照顺序执行所有的script;asyncasync的设置,会使得script脚本异步的加载并在允许的情况下执行async的执行,并不会按着script在页面中的顺序来执行,而是谁先加载完谁执行。...
前端文件类型数据请求 // Excel导入 onImport(params) { console.log('files',params) // 创建formData对象 const formData = new FormData() // 向formData添加数据 formData.append('file', params.file) axios.post(this.hjh_path.ledger.fileInmport(),formData,{
vue-video-player视频组件使用 vue-video-player视频组件使用一、下载包npm install vue-video-player --save二、在main.js中引入包,注册组件import VideoPlayer from 'vue-video-player'Vue. use( VideoPlayer)三、在视频页面使用该组件<template> <el-dialog v-dialogDrag :title="titleList[titleType]" :v
弹框关闭,video视频进度条重置 video标签进度条重置<template> <el-dialog v-dialogDrag :title="titleList[titleType]" :visible="_visible" append-to-body @close="onCloseDialog()" @open="onOpenDialog" > <video id="videoID" loop="loop" ref="vueRef" :
swiper的autoplay属性自动轮播无效果的原因 因为swiper的版本原因需要单独引用:import SwiperCore, { Autoplay } from 'swiper/core';SwiperCore.use([Autoplay]);// 然后autoplay的自动轮播属性可以使用了new Swiper('.swiper-container', { slidesPerView: 3, spaceBetween: 3, loop: true, // 循环模式选项 observ
echarts+vue,根据窗口变化重新渲染 mounted() { this.initView() let that = this window.addEventListener("resize", () => { that.materialCharts.resize(); }); }, //在initView中 initView() { .... this.materialCharts = this.$echarts.init(document.getElementById('e
vue如何动态获取元素的宽width和高height vue的自定义指令directive自动计算宽度和高度变化Vue.directive('resize',{ // 指令的名称 bind(el, binding) { // el为绑定的元素,binding为绑定给指令的对象 let width = '', height = ''; function isReize() { const style = document.defaultView.getComputedStyle(el);
如何解决this.$refs[XXX].validate is not a function 相信有很多朋友对于动态生成el-form表单进行校验会出现以下情况:其实不用慌,在动态生成的时候this.$refs.form变成了一个数组,此时的校验可以这样写:this.$refs['form'][0].validate((valid) => { if(valid) { console.log('111') } else { this.$message.warning("");
前端从后端获取文件流后进行excel导出 前端从后端获取文件流后,如何进行excel导出接口请求: this.$http({ url: 'url', method: 'get', params: {ysbh:this.form.ysbh}, header: { headers: { 'Content-Type': 'application/x-download' } }, responseType: 'blob' }
微信小程序报错:Cannot read property ‘forceUpdate‘ of undefined 关于使用HBuilder X小程序运行报错问题:Cannot read property ‘forceUpdate‘ of undefined解决:主要是没有在HBuilder X中添加小程序开发者的appid。如下图:
A页面发起请求跳转到B页面后,如何在B页面获取A页面的数据? 如何获取在B页面获取对应请求A页面的数据?我们需要运用以下的几点知识就能进行操作:1、首先需要在A页面运用ajax()的请求来获取自己想要的数据。2、我们需要运用浏览器的缓存localStorage或者sessionStorage,在浏览器中保存自己想要获取的数据。3、在跳转到B页面后,就可以在B页面根据localStorage或者sessionStorage缓存来获取你想要拿到的数据。4、在浏览器存数据或者那数据的时候,有可能会是字符串、对象或者数组,假如你需要拿到的是数组或者对象类型的数据,你