JSFiddle - React, Tailwind, and code Playground

by nuysoft

HTML

<script src="//g.alicdn.com/thx/brix-release/require-config-css.js"></script>
<div bx-name="components/areapicker">
    [
        { id: '一线', name: '一线' },
        { id: '二线', name: '二线' },
        { id: '三线', name: '三线' },

        { id: 110000, pid: '一线', name: '北京市' },
        { id: 120000, pid: '一线', name: '天津市' },

        { id: 130000, pid: '二线', name: '河北省' },
        { id: 140000, pid: '二线', name: '山西省' },

        { id: 150000, pid: '三线', name: '内蒙古自治区' },
        { id: 210000, pid: '三线', name: '辽宁省' },
    ]
</div>

CSS

body {
  padding: 10px;
}

JavaScript

require(['brix/loader'], function(Loader){
    Loader.boot(function(){
        var instances = Loader.query('components/areapicker')
        instances.on('toggle.areapicker', function(event, values) {
            console.log(event, values)
        })
    })
})