How do I change `customize` dynamically, and why doesn't the component update with ticks?
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 42/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- nuxt, typescript
- Domain
- frontend
Research direction
Reproduce the two checkbox examples using the component and the local collection configured in app.config.ts, comparing svg and non-svg modes. Trace how customize, display, and reactive updates are handled, then verify that fill and stroke changes are reflected during the component lifecycle for both examples.
Written by the indexing model from the issue text.
Description
How do I change the fill and stroke during the lifecycle?
agreeonly works when not touching thedisplayproperty and usingsvgmode.agree2doesn't work, with or withoutsvgmode.
<script setup lang="ts">
const agree = ref(false)
const agree2 = ref(false)
const setChecked = (content: string) =>
content
.replaceAll(/stroke="[^"]*"/g, 'stroke="black"')
.replaceAll(/fill="[^"]*"/g, 'fill="white"')
const setUnchecked = (content: string) =>
content
.replaceAll(/stroke="[^"]*"/g, 'stroke="black"')
.replaceAll(/fill="[^"]*"/g, 'fill="yellow"')
const customize = (a, b) => (content: string) =>
content.replaceAll(/stroke="[^"]*"/g, `stroke="${a}"`).replaceAll(/fill="[^"]*"/g, `fill="${b}"`)
</script>
<template>
<label>
<input
v-model="agree"
required
type="checkbox"
class="invisible absolute -z-10"
>
<Icon
mode="svg"
:customize="setChecked"
name="local:checkbox"
:class="{ hidden: !agree }"
/>
<Icon
:class="{ hidden: agree }"
mode="svg"
:customize="setUnchecked"
name="local:checkbox"
/>
Yes
</label>
<label>
<input
v-model="agree2"
required
type="checkbox"
class="invisible absolute -z-10"
>
<Icon
mode="svg"
:customize="customize('black', 'white')"
name="local:checkbox"
:class="{ hidden: !agree }"
/>
<Icon
:class="{ hidden: agree }"
mode="svg"
:customize="customize('black', 'yellow')"
name="local:checkbox"
/>
Yes
</label>
</template>
SVG
<svg width="20" height="20" viewBox="0 0 20 20" fill="none">
<rect x="0.5" y="0.5" width="19" height="19" rx="3.5" fill="#24A3B6"/>
<rect x="0.5" y="0.5" width="19" height="19" rx="3.5" stroke="#24A3B6"/>
<g clip-path="url(#clip0_4188_74097)">
<path d="M6 9.5L9.125 12.625L15.375 6.375" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
</g>
<defs>
<clipPath id="clip0_4188_74097">
<rect width="15" height="15" fill="white" transform="translate(3 2)"/>
</clipPath>
</defs>
</svg>
`app.config.ts`
// app.config.ts
export default defineAppConfig({
icon: {
size : '20px',
customCollections: [
{
prefix: 'local',
dir : './assets/images/icons/'
}
],
})
The number of times I've restarted Nuxt for debugging this is horrendous.
- Dominant language
- TypeScript
- Stars
- 1.2k
- Forks
- 97
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from nuxt/icon
-
Difficulty 2/5 1-3 hours Newbie friendliness 55/100
-
Allow separate providers for SSR and client (`provider: { server, client }`)Possibly taken @pont1s claimed this 25 days ago. Open
Difficulty 5/5 Over a week Newbie friendliness 45/100
-
Difficulty 3/5 1-2 days Newbie friendliness 65/100
-
Remote server bundle duplicates concurrent collection downloadsPossibly taken @onmax claimed this 48 days ago. Open
Difficulty 3/5 1-2 days Newbie friendliness 68/100
-
Difficulty 3/5 1-2 days Newbie friendliness 42/100
Similar issues
-
area:agent-view area:tui bug platform:macos
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
anthropics/claude-code#104558 ·
Maintainers usually reply within 1 day
-
updater
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
UniversityOfHelsinkiCS/oodikone#5141 ·
-
maintanance
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
inmanta/web-console#7606 ·
Maintainers usually reply within 1 day
-
bug skills
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
equinor/fusion-framework#5846 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 74/100