
Vue
等下吃什么?
余幼时即厌学
展开
-
Vue3 + Scss 覆盖Element样式
Vue3 + Scss 覆盖Element样式原创 2024-10-26 11:36:14 · 224 阅读 · 0 评论 -
import.meta.glob 自动读取路由
import.meta.glob 自动读取路由原创 2024-09-09 10:28:55 · 608 阅读 · 0 评论 -
chainWebpack写法合集
chainWebpack写法合集原创 2023-06-18 18:02:28 · 2043 阅读 · 0 评论 -
Vue 异步组件的写法
Vue 异步组件的写法原创 2023-03-13 23:15:08 · 211 阅读 · 0 评论 -
Vue中使用WebWorker
Vue中使用WebWorker原创 2023-02-23 18:12:13 · 4386 阅读 · 2 评论 -
Vant picker组件多列联动
Vant picker组件多列联动原创 2022-07-30 15:37:44 · 2452 阅读 · 2 评论 -
vue-3d-model 使用总结
vue-3d-model 使用总结原创 2022-06-05 14:53:38 · 7239 阅读 · 12 评论 -
Vue 插值语法中用可选链
Vue 插值语法中用可选链原创 2022-06-02 17:05:31 · 621 阅读 · 0 评论 -
Vue 使用特殊字体
// App.vue...<style lang="less"> @font-face { font-family: "BebasNeue"; src: url("./font/BebasNeue.otf"); font-weight: normal; font-style: normal; }</style>原创 2022-05-29 19:30:37 · 385 阅读 · 0 评论 -
Vue keyframe动画不生效
keyframe不要写在scoped里<style scope> // 这里的不生效 @keyframes spin { from{ transform: rotateY(0deg); } to{ transform: rotateY(360deg); } }</style><style> // 这里的生效 @keyframes spin { from{ transfo原创 2022-05-25 15:44:51 · 1643 阅读 · 0 评论 -
Vue、React 封装Lottie
<template> <div v-if="visible" ref="animationRef" :style="{...styles}" :class="['lottie-animate', ...className]" /></template><script> import lottie from 'lottie-web'; export default { props: {原创 2022-05-25 09:36:48 · 236 阅读 · 0 评论 -
Vue 双向绑定原理
Object.defineProperty 给每个属性添加get、set方法,监听数据的变化Class Observer { constructor(data) { this.observer(data); } observer(data) { if (data && typeof data === 'object') { for (let key in data) { this.defineReactive(data, key原创 2022-04-18 14:07:36 · 446 阅读 · 0 评论 -
Vue 组件按需引入
【src/router/index.js】import Vue from 'vue';import VueRouter from 'vue-router';// 无论组件有没有用,都会被加载import SectionA from '../views/SectionA';import SectionB from '../views/SectionB';import SectionC from '../views/SectionC';// 组件按需加载const SectionA = (原创 2022-04-15 23:03:29 · 503 阅读 · 0 评论 -
Vue 图片懒加载
图片懒加载【安装】npm i vue-lazyload -S【main.js】import Vue from 'vue';import App from './App.vue';import VueLazyload from 'vue-lazyload';Vue.use(VueLazyload, { error: './assets/images/error.png', loading: './assets/images/loading.gif'})/* eslint-d原创 2022-04-15 23:01:07 · 75 阅读 · 0 评论 -
Vue 打包上架刷新404
【src/router/index.js】import Vue from 'vue';import Router from 'vue-router';Vue.use(Router);const router = new Router({ ... mode: 'history', // 刷新404 mode: 'hash' // 可以解决404,但是hash路由不利于SEO})export default router;...原创 2022-04-15 22:57:38 · 162 阅读 · 0 评论 -
Vue SEO优化之预渲染
预渲染服务端渲染 优 - 首屏加载快(HTML在后端完成,前端请求JS/CSS资源即可) - 利于SEO 缺 - 传输数据量大 预渲染: 针对路由生成HTML 原理: 打包时模拟浏览器提前访问路由对应的页面,生成html文件 优: 有多个界面,利于SEO 缺: 首屏加载慢 服务端渲染:新闻、电商等重SEO客户端渲染:强交互、不重SEO预渲染:只需改善少数页面的SEO【安装】vue add prerender-spa【vue.config.js】原创 2022-04-15 22:45:38 · 595 阅读 · 0 评论