摘要: data () { return { // 用于保存防抖的定时器 timeout: null, } } methods: { // 防抖函数 debounce (fn, delay) { if (this.timeout) { clearTimeout(this.timeout) } this.ti 阅读全文
posted @ 2022-09-30 12:26 Ocean- 阅读(257) 评论(0) 推荐(0) 编辑
摘要: window上有两个方法window.onfocus 当进入当前页面时会执行的事件监听window.onblur 当离开当前页面时会执行的事件监听 window.onfocus = function () { document.title = '页面正常了...'; }; window.onblur 阅读全文
posted @ 2022-09-05 15:01 Ocean- 阅读(107) 评论(0) 推荐(0) 编辑
摘要: <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>获取高度宽度</title> <style> #myDIV { height: 250px; width: 400px; padding: 10px; margin: 15px; 阅读全文
posted @ 2022-07-25 10:38 Ocean- 阅读(530) 评论(0) 推荐(0) 编辑
摘要: 1.验证只能输入数字 value.replace(/[^\d]/g,'') 2.验证只能输入数字和小数,小数且只能输入2位,第一位不能输入小数点 value.replace(/[^\d.]/g, "").replace(/\.{2,}/g, ".").replace(".", "$#$").repl 阅读全文
posted @ 2022-06-20 09:37 Ocean- 阅读(6318) 评论(0) 推荐(0) 编辑
摘要: <template> <el-table :data="tableData" @row-click="rowClick" row-key="id" :expand-row-keys="expands" style="width: 100%" > <el-table-column type="expa 阅读全文
posted @ 2022-03-28 11:12 Ocean- 阅读(512) 评论(0) 推荐(0) 编辑
摘要: <template> <div class="filter_country"> <div class="checkbox_text">选择国家(可多选)</div> <div class="checkbox_text_right"> <div class="country_flag"> <div c 阅读全文
posted @ 2021-12-23 17:07 Ocean- 阅读(130) 评论(0) 推荐(0) 编辑
摘要: 比如我们要引入一个名叫 “men.js”的外部js文件 <template> <div></div> </template> <script> const menu = require("./menu"); //在此处引入js文件 export default {}; </script> <styl 阅读全文
posted @ 2021-12-20 13:51 Ocean- 阅读(3668) 评论(0) 推荐(0) 编辑
摘要: 通过 this.$store.commit("checkLayout", 要存储的数据); 在需要监听的页面 watch: { "$store.state.secret"() { console.log("获得" + this.$store.state.secret); }, }, 在vuex中定义 阅读全文
posted @ 2021-12-20 10:56 Ocean- 阅读(437) 评论(0) 推荐(0) 编辑
摘要: <template> <div style="color: white"> <div>关键词组:</div> <div class="add-input" v-for="(item, index) in updataData" :key="index"> <div style="flex: 1"> 阅读全文
posted @ 2021-12-20 10:44 Ocean- 阅读(1018) 评论(0) 推荐(0) 编辑
摘要: <template> <div> <div style="color: red" @click="minus">-</div> <el-date-picker v-model="FullTime" type="date" placeholder="选择日期时间" align="right" date 阅读全文
posted @ 2021-12-20 10:08 Ocean- 阅读(3804) 评论(0) 推荐(0) 编辑