Skip to content

Instantly share code, notes, and snippets.

View Zenquan's full-sized avatar
🤔
thinking and coding...

Zenquan Zenquan

🤔
thinking and coding...
View GitHub Profile
@Zenquan
Zenquan / responsive.scss
Created June 9, 2022 07:03
使用css媒体查询来实现pc和移动端自适应
‎‎​
@Zenquan
Zenquan / PicImg.vue
Last active April 28, 2022 07:50
包含cdn优化的图片组件
<template>
<picture v-if="src" v-lazy="getWebpImage(src)">
<source type="image/webp" :srcset="getWebpImage(src)" />
<source type="image/jpeg" :srcset="getWebpImage(src)" />
<img :src="getWebpImage(src)" alt="" />
</picture>
<img src="@/assets/img/pet_default.png" v-else />
</template>
<script setup lang="ts">
interface Props {
// fix for 1px problem
@mixin b-b-1($color) {
position: relative;
&::before {
content: "";
position: absolute;
left: 0;
top: 0;
width: 200%;
border-bottom: 1px solid $color;
@Zenquan
Zenquan / addLessLoader_forCRA5.js
Created April 9, 2022 09:10 — forked from casamia918/addLessLoader_forCRA5.js
addLessLoader for create-react-app@5.0.0
/**
* addLessLoader_forCRA5
* customized addLessLoader of customize-cra for create-react-app@5.0.0
*
* CreatedAt : 2022-01-09
*
* Description: The customize-cra author copy getStyleLoaders codes from react-scripts@4.0.3 > webpack.config.js
* But as react-scripts upgrade to version 5, they also upgrade postcss-loader, which causes change of options schema.
* So, I re-copy getStyleLoaders codes from react-scripts@5.0.0 > webpack.config.js
*