You've already forked AstralRinth
forked from didirus/AstralRinth
refactor(ui): move Toggle component to Composition API + TS (#3281)
* refactor(frontend): move Toggle component to Composition API + TS **Toggle.vue**: - Enable composition API and TS - Added `disabled` to props - Remove redundant `checked` - Replace `modelValue` and `emits` with `defineModel` compiler macro **Others**: - Replace emit handling and `model-value` with `v-model` where simple logic was used - Not `FeatureFlagSettings.vue` (contained custom code on receiving emit) - Not `Mods.vue` (contained custom code on receiving emit) - Remove redundant `checked` attribute * fix(app): toggles not updating value
This commit is contained in:
@@ -40,12 +40,7 @@
|
||||
</span>
|
||||
<span> Whether or not the subscription should be unprovisioned on refund. </span>
|
||||
</label>
|
||||
<Toggle
|
||||
id="unprovision"
|
||||
:model-value="unprovision"
|
||||
:checked="unprovision"
|
||||
@update:model-value="() => (unprovision = !unprovision)"
|
||||
/>
|
||||
<Toggle id="unprovision" v-model="unprovision" />
|
||||
</div>
|
||||
<div class="flex gap-2">
|
||||
<ButtonStyled color="brand">
|
||||
@@ -114,7 +109,7 @@
|
||||
</div>
|
||||
</template>
|
||||
<script setup>
|
||||
import { Badge, NewModal, ButtonStyled, DropdownSelect, Toggle } from "@modrinth/ui";
|
||||
import { Badge, ButtonStyled, DropdownSelect, NewModal, Toggle } from "@modrinth/ui";
|
||||
import { formatPrice } from "@modrinth/utils";
|
||||
import { CheckIcon, XIcon } from "@modrinth/assets";
|
||||
import { products } from "~/generated/state.json";
|
||||
|
||||
Reference in New Issue
Block a user