Skip to content

Get initial value in custom component #3636

Answered by fullbl
fullbl asked this question in Q&A
Discussion options

You must be logged in to vote

seems I was able to solve it myself (still not sure on when the data is passed). This is my switch component!

<template>
  <div>
    <label class="relative flex items-center mb-4 cursor-pointer">
      <div
        class="
          h-6
          bg-gray-200
          border-2 border-gray-200
          rounded-full
          toggle-bg
          w-11
        "
        v-if="disabled"
      ></div>
      <Switch
        v-model="value"
        :class="[
          checked ? 'bg-indigo-600' : 'bg-gray-200',
          'relative inline-flex flex-shrink-0 h-6 w-11 border-2 border-transparent rounded-full cursor-pointer transition-colors ease-in-out duration-200 focus:outline-none focus:ring-2 fo…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by fullbl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant