import { createNamespace } from '../utils'; import Tab from '../tab'; import Tabs from '../tabs'; const [createComponent, bem] = createNamespace('cascader'); export default createComponent({ props: { value: Array, title: String, options: Array, placeholder: String, activeColor: String, closeable: { type: Boolean, default: true, }, }, data() { return { tabs: [], activeTab: 0, }; }, watch: { options() { // reset options and tab }, value() { // reset options and tab }, }, created() { this.init(); }, methods: { init() { if (this.value) { // } else { this.tabs = [ { title: this.placeholder || this.t('placeholder'), options: this.options, }, ]; } }, genHeader() { return (

{this.slots('title') || this.title}

); }, genTabs() { return ( {this.tabs.map((item) => ( {this.genOptions(item.options)} ))} ); }, genOptions(options) { return ( ); }, }, render() { return (
{this.genHeader()} {this.genTabs()}
); }, });