We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
customize
How do I change the fill and stroke during the lifecycle?
fill
stroke
agree
display
svg
agree2
<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 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 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.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
How do I change the
fill
andstroke
during the lifecycle?agree
only works when not touching thedisplay
property and usingsvg
mode.agree2
doesn't work, with or withoutsvg
mode.SVG
`app.config.ts`
The number of times I've restarted Nuxt for debugging this is horrendous.
The text was updated successfully, but these errors were encountered: