摘要: window.parent.postMessage 解决iframe父子页面域名不一样出现的跨域问题 内嵌 iframe 页面,一般使用 window.parent 或 window.top 来获取父页面的 window 对象 在子页面 想使用(或传递给) 父页面的参数,但是原因两个的域名不一样,所 阅读全文
posted @ 2022-07-11 15:02 挥不去的执念 阅读(5245) 评论(0) 推荐(0) 编辑
摘要: vue解决点击事件冒泡 .stop <div @click="toCourse()" > <van-button type="primary" @click.stop="booking()">报名</van-button> </div> 阅读全文
posted @ 2022-07-05 11:37 挥不去的执念 阅读(194) 评论(0) 推荐(0) 编辑
摘要: vite.config.ts resolve.alias 配置 const path = require('path'); import { defineConfig } from 'vite'; import vue from '@vitejs/plugin-vue'; // https://vi 阅读全文
posted @ 2022-06-20 16:46 挥不去的执念 阅读(315) 评论(0) 推荐(0) 编辑
摘要: 1.创建项目 npm init vite@latest 依次输入项目名称、选择vue、选择ts 2.引入依赖 cd 项目名称 npm install 3.启动项目 npm run dev 4.引入vue-router npm install vue-router@4 -S 在src目录下新建rout 阅读全文
posted @ 2022-06-20 16:27 挥不去的执念 阅读(734) 评论(0) 推荐(0) 编辑
摘要: 1、进度条的用的是vant的Progress组件,比手写进度条方便很多,有自带的事件 2、H5页面兼容pc 效果展示 上代码 一、template模块 <template lang="pug"> .audioPlay main .audioBox .imgBox van-image.songImg( 阅读全文
posted @ 2022-06-07 12:07 挥不去的执念 阅读(2688) 评论(0) 推荐(0) 编辑
摘要: 注意: 使用之前请确定使用的swiper版本,避免走一些不必要的弯路(笔者踩过来的)本文采用的是vue3.0、swiper^8.1.0。 1、安装依赖 npm install swiper 2、vue文件引入 <template> <swiper :slides-per-view="3" :navi 阅读全文
posted @ 2022-04-13 10:47 挥不去的执念 阅读(6185) 评论(0) 推荐(0) 编辑
摘要: vue3微信支付和支付宝支付 // 判断是否为微信内置浏览器 let browser: any = navigator.userAgent.toLowerCase(); let isWechat: any = browser.match(/MicroMessenger/i) == "micromes 阅读全文
posted @ 2022-03-29 14:47 挥不去的执念 阅读(1226) 评论(0) 推荐(0) 编辑
摘要: vue3+ts获取dom元素高度 <template> <div class="digestDetail-indedx"> <div class="video" ref="video"> <video controls="controls" webkit-playsinline="true" x-w 阅读全文
posted @ 2022-03-18 15:54 挥不去的执念 阅读(3289) 评论(0) 推荐(0) 编辑
摘要: vue3验证码倒计时60s //倒计时60s const timeNum = ref(60); const countDown = ref(); const isShowSend = ref(true); const getSetInterval = (): void => { countDown. 阅读全文
posted @ 2022-03-14 17:49 挥不去的执念 阅读(956) 评论(0) 推荐(0) 编辑
摘要: {path:'/blog',name:'blog',params:{is:true}} 阅读全文
posted @ 2022-03-08 15:19 挥不去的执念 阅读(42) 评论(0) 推荐(0) 编辑