vue.js?? ???? ???? ?? ???? ? ????. ??? ??? ????? ??? ?? ???? ???? ?? ???? ?? ?? ??? ??? ? ? ????. SVG? ??? ???? ????? ?? ???? ???? ???? ??? ??? ?????.
? ??? ???? ?? ??? ??? ? vue.js ?? ??????? ???? SVG ??? ???? ?????.
- ??? ??/?? : ??? ???? SVG? ????? ???? ??????.
- ??? : ??? ???? ????? ???? ?????
<svg-icon icon="rocket"></svg-icon>
. - ???? : CSS
font-size
?color
??? ???? ??? ? ?? ???, ??? ?? ??? ?????. - ??? : ??? ???? ?? ????? ?? SVG ?? ??? ????.
- ? ? ?? : ? ? ?? ??? ???? ????.
? ???? ? ?? ?? ?? ?? VUE ?? ??? ???? ???? ??? ??????.
- Webpack : Vue Cli? ???? ?? ??????.
-
svg-inline-loader
:npm install svg-inline-loader --save-dev
. ? ??? SVG ??? ???? ??? ?????.
SVG ????? ?? ?? ( SvgSprite.vue
)
SVG ?? ??? ???? ?? ?? ?? SVG ???? ?? ? ??? SVG ? SVG ?????? ????. ????<use></use>
??? ID? ???? ?? :<svg><use xlink:href="#rocket"></use></svg>
. SvgSprite
?? ??? ??? ?????.
<template> <svg height="0" style="display: none;" v-html="$options.svgSprite" width="0"></svg> </template> <script> const svgContext = require.context( '!svg-inline-loader?' 'removeTags=true' // Remove title tags, etc. '&removeSVGTagAttrs=true' // Remove attributes '&removingTagAttrs=fill' // Remove fill attributes '!@/assets/icons', // Icon directory true, // Search subdirectories /\w \.svg$/i // Only include SVG files ); const symbols = svgContext.keys().map(path => { const id = path.replace(/^\.\/(.*)\.\w $/, '$1'); // Extract ID from filename const content = svgContext(path); // Get SVG content return content.replace('<svg', `<symbol id="${id}"`).replace('svg>', 'symbol>'); // Convert to symbol }); export default { name: 'SvgSprite', svgSprite: symbols.join('\n'), // Concatenate symbols }; </script>
????? ??? ?? ?????<svg></svg>
???? $options.svgSprite
? ?? ???? ???? ?? .svgsprite. ????? svg-inline-loader
???? require.context
???? SVG? ???? ???? ??? ??? ?????. ?? ?? ? SVG? a? ?????<symbol></symbol>
?? ? ID ?? ??.
? ?? ??? App.vue
??? ??? ??????.
??? ?? ?? ( SvgIcon.vue
)
SvgIcon
?? ??? ? ?????<use></use>
??????? ???? ???? ?? :
<template> <svg class="icon" :class="{ 'icon-spin': spin }"> <use :xlink:href="`#${icon}`"></use> </svg> </template> <script> export default { name: 'SvgIcon', props: { icon: { type: String, required: true }, spin: { type: Boolean, default: false }, }, }; </script> <style scoped> svg.icon { fill: currentColor; height: 1em; margin-bottom: 0.125em; vertical-align: middle; width: 1em; } svg.icon-spin { animation: icon-spin 2s infinite linear; } @keyframes icon-spin { from { transform: rotate(0deg); } to { transform: rotate(359deg); } } </style>
CSS? ??? ???? ??? ???? ???? ?? ??? ?? ??? ???????. spin
??? ?????? ?????.
? ?? ??? main.js
? ??????.
'vue'?? Vue ?? ?? '@/components/svgicon.vue'?? svgicon ?? ?? vue.component ( 'svg-icon', svgicon)
? ???? vue.js ?? ?????? SVG ???? ?????? ???? ????? ?? ?? ?? ??? ???? ?????. ?? ???? ? ?? ??? ?? ? ? ?? ??? ??/?? ?? ???? ??? ? ????.
? ??? VUE ? ?? ??? SVG ??? ???? ?? ?????. ??? ??? PHP ??? ????? ?? ?? ??? ?????!

? AI ??

Undress AI Tool
??? ???? ??

Undresser.AI Undress
???? ?? ??? ??? ?? AI ?? ?

AI Clothes Remover
???? ?? ???? ??? AI ?????.

Clothoff.io
AI ? ???

Video Face Swap
??? ??? AI ?? ?? ??? ???? ?? ???? ??? ?? ????!

?? ??

??? ??

???++7.3.1
???? ?? ?? ?? ???

SublimeText3 ??? ??
??? ??, ???? ?? ????.

???? 13.0.1 ???
??? PHP ?? ?? ??

???? CS6
??? ? ?? ??

SublimeText3 Mac ??
? ??? ?? ?? ?????(SublimeText3)

??? ??











CSS? ??? ??? ????? ????? ??? ? ?? CSS? ????? ?? ??????, ?? ?? ? ??? ??, ??? ?? ?? ??? CSS ? ????? ?? ??? ?? ???? ???? ??? ??? ???. 1. ?? CSS? ???? HTML? ?? ?????. 2. JavaScript? ?? ??? CSS ??; 3. ??? ??? ???? ?? ???? ????? ??????. 4. CSS? ???? ???? ??? ????. ?? CSS? ???? ?? ??? ???? Rel = "Preload"?????? ????, ??? ?? ??? ????? ???? ??? ?? ? ??? ???? ??? ?????.

TheBestoproachforcssdspectionseproject'sspecificneeds.forlargerProjects, externalcsSisbetterduetomainabainabainabilitableability ? forsmallerprojectsorsingle-pageapplications, ?? csmightbemoresuitable.it 'scrucialtobalanceprojectsize, ??

???, cssdoesnothavetobeInlowercase. ???, lowercaseisRecomedended for : 1) ??? ? ??, 2) ??? ?? rorsinerrorsinerrorsIngerRorsIngerRorsInteChnologies, 3) ??? ?? ??, ? 4) ?? ? ???? ????.

cssismostlycase-Insensitive, buturlsandfamilynamesarecase-insensitive.1) propertiesandvalueslikecolor : red; anteOtcase-inditive.2) urlsmustmatchtheserver'scase, ?? ??,/images/logo.png.3) fontfamilynames'opens'mustoccase.

AutoPrefixer? ?? ???? ??? ???? ?? ?? ???? CSS ??? ???? ???? ?????. 1. ????? ???? ???? ???? ??? ?????. 2. PostCSS ???? ??, CSS? ?? ???? ???? ?? ???? ??? ???? ??? ?? ??? ?????. 3. ?? ???? ???? ??, ??????? ?? ? ?? ???????? ????? ?? ?????. 4. ???? ???? ???? ???? ?? ?? ????, ???? ?? ??? ?? ???? ???? ????? ?? ???? ?? ????.

CSSCOUNTERSCANAUTOMALLYNUMBERSESSESSENDS.1) USECOUNTER-RESETTIONITIALIZE, CORKENT-INCREMENTTOINCERES, andCOUNTER () ORCOUNTERS () TODISPLAYVALUES.2) COMPINEWITHJAVAISCRIPTORDINAMICCONTENTTOEREACCUTERUPDATES.

CSS?? ??? ? ?? ??? ?? ??? ???? ??, ??, URL ? ??? ?? ????? ?? ?? ??? ?????. 1. ???? ?? ??? ??? ? ???? ?? ?? ??? ??????. 2. ?? 16 ?? ??? ?? ??? ?????, ??? ???? ???? ?? ??? ??? ???? ????. 3. URL? ??? ???? ???? ??? ??? ? ????. 4. ??? ?? ?? (??)? ??? ???? ??? ? ???? ??????? ???????.

cssselectorsandpropertynamesarecase-inensensitive, whilevaluescanbecase-sensitivendependingOntext.1) selectorsike'div'and'div'areequivalent.2) propertiessuchas'background'and'background-color'AretreatedThesame.3) ValueLikecolornames-insens
