![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
vue
魑魅魍魉魈
这个作者很懒,什么都没留下…
展开
-
vue3 组件内使用路径
使用vite打包时不能将组件的路径进行编译。通过modules解决<template> <div class="t-img" v-bind="attr"> <img :src="src?.default" alt="" /> </div></template><script lang="ts" setup>import { defineProps, useAttrs, ref, onMounted } fro原创 2021-11-15 13:40:03 · 875 阅读 · 0 评论 -
简易懒加载
简易图片的懒加载函数function imgLazyLoad(evet:any = null) { const scrollTop = document.documentElement.scrollTop; const clientHeight = document.documentElement.clientHeight; imgs.value?.forEach((e) => { if ( e.parentElement && e.par原创 2021-11-15 13:37:01 · 356 阅读 · 0 评论 -
KOA的基础使用
只是最基础的使用,很多特性都没有用上,准备用来部署vue打包后的dist文件废话不多说,直接上代码// 导入koa模块const Koa = require('koa');const Router = require('koa-router')// 创建koa的实例appconst koaBody = require('koa-body');const koaStatic = require('koa-static');const path = require('path');const原创 2021-11-12 17:51:54 · 674 阅读 · 0 评论 -
用extend替代vuex的方案
store/index.jsimport Vue from 'vue'const store = Vue.extend({ name: 'store', data() { return { count: 2, person: { name:'小明', age:23 } } }, methods:{原创 2021-10-19 17:50:44 · 307 阅读 · 0 评论