1.0.19 • Published 5 years ago

aotoo-react-tabs v1.0.19

Weekly downloads
3
License
MIT
Repository
github
Last release
5 years ago

aotoo-react-tabs

Install

# install
yarn add aotoo-react-tabs

USAGE

Depends on aotoo this library, Aotoo is a global variable

import aotoo from 'aotoo'
require('aotoo-web-widgets')
require('aotoo-react-tabs')

const WrapElement = Aotoo.wrap( <div>这个真好吃</div>, {
  rendered: function(dom){ /* after reactDom didMounted then ... */ },
  leave: function(){ /* before reactDom will be unmounted then ..*/ }
})

const tabs = Aotoo.tabs({
  props: {
    tabClass: 'tabs-nornal-top',
    data: [
      {title: 'aaa', content: '什么, what'},
      {title: 'bbb', content: '来了'},
      {title: 'ccc', content: <WrapElement />},
    ]
  }
})

tabs.render('id')  // reader tabs to some dom with id
// cosnt xxx = tabs.render() ====> it's a jsx

API

$update(opts)

// ======== or full replacement
tabs.$update({
  data: [
    {title: 'one', content: 'abcccc'},
    {title: 'two', content: 'uuuyyy'},
    ...
  ]
})

The above operation causes the structure to be re-rendered and the callback method rendered is executed again

$select(index)

tabs.$select({ select: 2 })

access the above operation, you can dynamically append the structure after you append the data(_data)

1.0.19

5 years ago

1.0.18

5 years ago

1.0.17

5 years ago

1.0.16

5 years ago

1.0.15

6 years ago

1.0.14

6 years ago

1.0.13

6 years ago

1.0.12

6 years ago

1.0.11

6 years ago

1.0.10

6 years ago

1.0.9

6 years ago

1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago