11<script setup lang="ts">
2- import { watchEffect , ref } from ' vue'
2+ import { ref , watchEffect } from ' vue'
3+ import { features , type Filter , languages , ruleFilters , ruleTypes } from ' ./data'
34import Option from ' ./Option.vue'
4- import {
5- languages ,
6- ruleFilters ,
7- features ,
8- ruleTypes ,
9- type Filter ,
10- } from ' ./data'
115
126const model = defineModel <Filter >()
137
@@ -25,29 +19,28 @@ watchEffect(() => {
2519watchEffect (() => {
2620 filter .value = model .value !
2721})
28-
2922 </script >
3023<template >
3124 <form class =" filters" >
3225 <details open >
3326 <summary >📚 Example Language</summary >
3427 <div class =" checkbox-group" >
35- <label v-for =" displayName, lang in languages" :key =" lang" >
28+ <label v-for =" ( displayName, lang) in languages" :key =" lang" >
3629 <input type =" checkbox" v-model =" filter.selectedLanguages" :value =" lang" >
37- <Option :text =" displayName" class =" filter-option" />
30+ <Option :text =" displayName" class =" filter-option" />
3831 </label >
3932 </div >
4033 </details >
4134
4235 <details open >
4336 <summary >📏 Used Rule</summary >
4437 <div class =" filter-group rule-filter-group" >
45- <div v-for =" rules, type in ruleFilters" >
46- <em style =" text-transform : capitalize ; " >{{ type }}</em >
38+ <div v-for =" ( rules, type) in ruleFilters" >
39+ <em style =" text-transform : capitalize " >{{ type }}</em >
4740 <div class =" checkbox-group" >
4841 <label v-for =" rule in rules" :key =" rule" >
4942 <input type =" checkbox" v-model =" filter.selectedRules" :value =" rule" >
50- <Option :text =" rule" class =" filter-option" />
43+ <Option :text =" rule" class =" filter-option" />
5144 </label >
5245 </div >
5346 </div >
@@ -56,7 +49,7 @@ watchEffect(() => {
5649 <div class =" checkbox-group" >
5750 <label v-for =" type in ruleTypes" :key =" type" >
5851 <input type =" checkbox" v-model =" filter.selectedTypes" :value =" type" >
59- <Option :text =" type" class =" filter-option" />
52+ <Option :text =" type" class =" filter-option" />
6053 </label >
6154 </div >
6255 </div >
@@ -71,7 +64,7 @@ watchEffect(() => {
7164 <div class =" checkbox-group" >
7265 <label v-for =" feature in features" :key =" feature" >
7366 <input type =" checkbox" v-model =" filter.selectedFeatures" :value =" feature" >
74- <Option :text =" feature" class =" filter-option" />
67+ <Option :text =" feature" class =" filter-option" />
7568 </label >
7669 </div >
7770 </div >
@@ -150,11 +143,11 @@ input[type="checkbox"]:checked + code.option:hover {
150143
151144@keyframes details-show {
152145 from {
153- opacity :0 ;
146+ opacity : 0 ;
154147 transform : translateY (-0.5em );
155148 }
156149}
157150details [open ] > * :not (summary ) {
158151 animation : details-show 0.2s ease-in-out ;
159152}
160- </style >
153+ </style >
0 commit comments