iview tabs里面放入 i-switch 注意slot不是写在 props里面

iview tabs里面放入 i-switch 注意slot不是写在 props里面

<Tabs value="name1">
        <TabPane :label="beforeSwitch"
                 name="name1">事前填报</TabPane>
        <TabPane label="事后填报"
                 name="name2">事后填报</TabPane>
      </Tabs>
beforeSwitch: (h) => {
        return [
          h('span', '事前填报'),
          h('i-switch', {
            props: {
              size: 'large',
              value: this.beforeSwitchVal
            },
            on: {
              input (e) {
                this.beforeSwitchVal = e
              }
            }
          }, [
            h('span', {
              slot: 'open'
            }, '开启'),
            h('span', {
              slot: 'close'
            }, '关闭')
          ])
        ]
      },
原文地址:https://www.cnblogs.com/pengchenggang/p/10530482.html