Coder Social home page Coder Social logo

Comments (3)

chandranoor avatar chandranoor commented on June 28, 2024 1

Oh I see, I will look into code used in the documentation for other components

Thanks for your reply, it's really helpful.

from mijin.

lecoueyl avatar lecoueyl commented on June 28, 2024

Hi @chandranoor

The code in the documentation is quite dummy and will not work if pasted directly since it needs a data to bind.
You can view the code used in the documentation:
https://github.com/lecoueyl/mijin.web/blob/main/src/pages/docs/atoms/segmentedControl.vue
https://github.com/lecoueyl/mijin.web/blob/main/src/pages/docs/atoms/tabs.vue

Or you should be able to use the component like this:

<template>
  <div>
    <MjSegmentedControl>
      <MjSegmentedControlItem
        :selected="selectedItem === 'banana'"
        @select="selectedItem = 'banana'"
      >
        Banana
      </MjSegmentedControlItem>
      <MjSegmentedControlItem
        :selected="selectedItem === 'orange'"
        @select="selectedItem = 'orange'"
      >
        Orange
      </MjSegmentedControlItem>
      <MjSegmentedControlItem
        :selected="selectedItem === 'kiwi'"
        @select="selectedItem = 'kiwi'"
      >
        Kiwi
      </MjSegmentedControlItem>
    </MjSegmentedControl>
  </div>
</template>

<script>
export default {
  data() {
    return {
      selectedItem: "banana",
    };
  },
};
</script>

Hope it helps, and thank you for your interest!

from mijin.

lecoueyl avatar lecoueyl commented on June 28, 2024

I'm going to close this issue since no response for 14 days.
If you feel this issue should be reopened, create a new issue linking back to this one for added context. Thanks!

from mijin.

Related Issues (5)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.