Fork me on GitHub

随笔分类 -  Vue.js

摘要:1. 新建js文件 export default (app) => { app.directive('loadmore', { beforeMount(el, binding) { const element = el.querySelector('.t-select__dropdown'); el 阅读全文
posted @ 2023-04-28 16:33 欢欢11 阅读(1351) 评论(0) 推荐(0) 编辑
摘要:1. debounce.js import { customRef } from 'vue'; export function debounceRef(value, delay = 1000) { let timer; return customRef((track, trigger) => { r 阅读全文
posted @ 2023-02-02 15:18 欢欢11 阅读(25) 评论(0) 推荐(0) 编辑
摘要:<t-table v-show="false" id="exportTab" row-key="index" :data="allData" :columns="allColumns"> <template #createTime="{ row }"> {{ getDateDiff(row.crea 阅读全文
posted @ 2022-12-06 11:19 欢欢11 阅读(425) 评论(0) 推荐(0) 编辑
摘要:// 自己使用 <div v-for="item in ['lisi','wanger']" :key="item"> <test :ref="(el) => setGraphRef(el, item)" /> </div> const setGraphRef = (el, type) => { i 阅读全文
posted @ 2022-11-21 15:59 欢欢11 阅读(1821) 评论(0) 推荐(0) 编辑
摘要:vue+webpack中,可以使用require imageList: [ { url: require('../image/pig.png') } ] vue+vite没有require方法 // 静态图片一般放在src/assets下面 1. 单个文件 import pig from '@/as 阅读全文
posted @ 2022-10-25 17:44 欢欢11 阅读(299) 评论(0) 推荐(0) 编辑
摘要:1. h() 函数是一个用于创建 vnode,其实在vue中是createVNode 函数的简写 h()函数接受三个参数 参数1. 标签名或组件 参数2. 标签的属性或事件 参数3. 内容使用: // 单个import {h} from 'vue' export default { render() 阅读全文
posted @ 2022-10-21 17:51 欢欢11 阅读(6225) 评论(0) 推荐(0) 编辑
摘要:// 爷组件 import { defineComponent, reactive, toRefs, onMounted, provide ,computed} from 'vue'; const state = reactive({ tableData: [], }); // 因为数据是异步的所以 阅读全文
posted @ 2022-09-28 15:32 欢欢11 阅读(1272) 评论(0) 推荐(0) 编辑
摘要:1. 在webpack中使用require来获取组件 / 参数:1. 目录 2. 是否加载子目录 3. 加载的正则匹配 //匹配当前文件夹下的所有.vue文件 注册全局组件 const importFn = require.context('./', false, /\.vue$/) // cons 阅读全文
posted @ 2022-09-15 10:09 欢欢11 阅读(425) 评论(0) 推荐(0) 编辑
摘要:1. wangeditor 富文本编辑器,https://www.wangeditor.com/ 阅读全文
posted @ 2022-08-29 11:04 欢欢11 阅读(24) 评论(0) 推荐(0) 编辑
摘要:1. vue3中 ref 和reactive的区别 当我们调用 ref 方法来定义响应式数据时,当参数为对象类型时,其实里面用的是 reactive 方法。.value 事实上是 reactive 方法创造出来的。 reactive 能做的ref也能做, reactive 不支持对基本类型数据响应式 阅读全文
posted @ 2022-05-30 10:43 欢欢11 阅读(36) 评论(0) 推荐(0) 编辑
摘要:1 npm install --save xlsx 2 npm install --save xlsx-style //如果需要修改样式,则需要安装 1.解决引入xlsx-style报错问题 2.找到:node_modules\xlsx-style\dist\xlsx.full.min.js 并把这 阅读全文
posted @ 2019-12-06 14:39 欢欢11 阅读(3795) 评论(0) 推荐(0) 编辑
摘要:v-model的修饰符 v-model.lazy 只有在input输入框发生一个blur时才触发 v-model.trim 将用户输入的前后的空格去掉 v-model.number 将用户输入的字符串转换成number 在input textarea select中使用 <input type="t 阅读全文
posted @ 2019-11-29 10:32 欢欢11 阅读(1006) 评论(0) 推荐(0) 编辑
摘要:原文地址: https://juejin.im/post/5dccdd24f265da0c09156fb3 1、是否合法IP地址 export function validateIP(rule, value,callback) { if(value==''||value==undefined||va 阅读全文
posted @ 2019-11-18 18:13 欢欢11 阅读(1812) 评论(0) 推荐(0) 编辑
摘要:export和import共用了导致不兼容引起的 npm install babel-plugin-transform-es2015-modules-commonjs 在.babelrc中配置 { "presets": [ ["env", { "modules": false }], "stage- 阅读全文
posted @ 2019-11-15 15:28 欢欢11 阅读(338) 评论(0) 推荐(0) 编辑
摘要:export default { ['--body-bgcolor']: '#fff', ['--light-bgcolor']: '#f5f5f5', ['--font-color']: '#4a4a4a', ['--font-color-shallow']: '#404040', ['--fon 阅读全文
posted @ 2019-11-01 18:16 欢欢11 阅读(610) 评论(0) 推荐(0) 编辑
摘要:转载处:https://juejin.im/post/5d9d386fe51d45784d3f8637 阅读全文
posted @ 2019-10-11 09:41 欢欢11 阅读(1614) 评论(0) 推荐(0) 编辑
摘要:1.npm install animate.css --save2.在main.js中 import animate from 'animate.css';3.使用: animated 不能漏 <view class="content animated fadeInRight">4. fade: { 阅读全文
posted @ 2019-10-04 17:52 欢欢11 阅读(773) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示