Skip to content

Commit

Permalink
chore(example): update example
Browse files Browse the repository at this point in the history
  • Loading branch information
wenqing committed May 18, 2023
1 parent fc9a910 commit 511e742
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion example/src/components/MaintenanceColors/index.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<div class="">
<FeatureSection>
<template #title> <code>Maintenance colors</code> </template>
<template #title> <code>Maintenance of colors</code> </template>

<template #sub-title>
Support maintenance SVG icon (monochrome) color via
Expand Down
2 changes: 1 addition & 1 deletion example/src/components/MaintenanceSize/index.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<div class="">
<FeatureSection>
<template #title> <code>Maintenance size</code> </template>
<template #title> <code>Maintenance of size</code> </template>

<template #sub-title>
You can change the SVG icon <b>size</b> with <code>font-size</code> or
Expand Down
2 changes: 1 addition & 1 deletion example/src/components/UrlQueryString/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<template #sub-title>
You can import SVG as a url via
<code>?url</code> query string, which can used by src of img element.
<code>?url</code> query string, which can be used by src of img element.
</template>

<template #demo>
Expand Down
8 changes: 4 additions & 4 deletions lib/index.cjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,13 +117,13 @@ const svg4VuePlugin = (options = {}) => {
type === 'raw') {
if (disabledSvgo || skipsvgo)
return source;
let cachedSvgRawResult = svgRawCache.get(idWithoutQuery);
let cachedSvgRawResult = svgRawCache.get(id);
if (!cachedSvgRawResult) {
const code = fs.readFileSync(idWithoutQuery, 'utf8');
const svg = await optimizeSvg(code, idWithoutQuery, finalSvgoConfig);
cachedSvgRawResult = compileSvgToRaw(svg);
if (enableBuildCache && isBuild) {
svgRawCache.set(idWithoutQuery, cachedSvgRawResult);
svgRawCache.set(id, cachedSvgRawResult);
}
}
return cachedSvgRawResult;
Expand All @@ -134,7 +134,7 @@ const svg4VuePlugin = (options = {}) => {
}
if ((defaultExport === 'component' && typeof type === 'undefined') ||
type === 'component') {
let cachedSvgComponentResult = svgComponentCache.get(idWithoutQuery);
let cachedSvgComponentResult = svgComponentCache.get(id);
if (!cachedSvgComponentResult) {
const code = fs.readFileSync(idWithoutQuery, 'utf8');
let svg = code;
Expand All @@ -143,7 +143,7 @@ const svg4VuePlugin = (options = {}) => {
}
cachedSvgComponentResult = await compileSvg(svg, idWithoutQuery);
if (enableBuildCache && isBuild) {
svgComponentCache.set(idWithoutQuery, cachedSvgComponentResult);
svgComponentCache.set(id, cachedSvgComponentResult);
}
}
return cachedSvgComponentResult;
Expand Down
8 changes: 4 additions & 4 deletions lib/index.esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,13 @@ const svg4VuePlugin = (options = {}) => {
type === 'raw') {
if (disabledSvgo || skipsvgo)
return source;
let cachedSvgRawResult = svgRawCache.get(idWithoutQuery);
let cachedSvgRawResult = svgRawCache.get(id);
if (!cachedSvgRawResult) {
const code = readFileSync(idWithoutQuery, 'utf8');
const svg = await optimizeSvg(code, idWithoutQuery, finalSvgoConfig);
cachedSvgRawResult = compileSvgToRaw(svg);
if (enableBuildCache && isBuild) {
svgRawCache.set(idWithoutQuery, cachedSvgRawResult);
svgRawCache.set(id, cachedSvgRawResult);
}
}
return cachedSvgRawResult;
Expand All @@ -112,7 +112,7 @@ const svg4VuePlugin = (options = {}) => {
}
if ((defaultExport === 'component' && typeof type === 'undefined') ||
type === 'component') {
let cachedSvgComponentResult = svgComponentCache.get(idWithoutQuery);
let cachedSvgComponentResult = svgComponentCache.get(id);
if (!cachedSvgComponentResult) {
const code = readFileSync(idWithoutQuery, 'utf8');
let svg = code;
Expand All @@ -121,7 +121,7 @@ const svg4VuePlugin = (options = {}) => {
}
cachedSvgComponentResult = await compileSvg(svg, idWithoutQuery);
if (enableBuildCache && isBuild) {
svgComponentCache.set(idWithoutQuery, cachedSvgComponentResult);
svgComponentCache.set(id, cachedSvgComponentResult);
}
}
return cachedSvgComponentResult;
Expand Down

0 comments on commit 511e742

Please sign in to comment.