ReactJS UI Ant Design Composant Cascader

import React from 'react'

import "antd/dist/antd.css";

import { Cascader } from 'antd';

 

export default function App() {

 

  return (

    <div style={{

      display: 'block', width: 700, padding: 30

    }}>

      <h4>ReactJS Ant-Design Cascader Component</h4>

      <>

        <Cascader

          option={[

            {

              value: 'Madhya Pradesh',

              label: 'Madhya Pradesh',

              children: [

                {

                  value: 'Indore',

                  label: 'Indore',

                  children: [

                    {

                      value: 'Vijay Nagar',

                      label: 'Vijay Nagar',

                    }, {

                      value: 'Bhawarkuwa',

                      label: 'Bhawarkuwa',

                    },

                    {

                      value: 'MR10',

                      label: 'MR10',

                    },

                  ],

                },

              ],

            },

          ]}

          onChange={(data) => { console.log(data) }}

          placeholder="Select destination" />

      </>

    </div>

  );

}

Laisser un commentaire

Votre adresse e-mail ne sera pas publiée. Les champs obligatoires sont indiqués avec *

Aller en haut