Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Layout] typescript类型未导出 #982

Open
hidden7123 opened this issue Dec 2, 2024 · 0 comments
Open

[Layout] typescript类型未导出 #982

hidden7123 opened this issue Dec 2, 2024 · 0 comments
Assignees

Comments

@hidden7123
Copy link
Contributor

重现链接或代码

import React from 'react'
import ReactDOM from 'react-dom'
import { Layout,ILayoutProps } from '@kdcloudjs/kdesign'

const Demo: React.FC = () => {
  const { Header, Footer, Sider, Content } = Layout
  const layoutStyle:ILayoutProps['style'] = { marginTop: 48 }
  const headerStyle:ILayoutProps['style'] = { color: '#fff', background: 'rgba(85, 130, 243, .7)' }
  const footerStyle:ILayoutProps['style'] = { color: '#fff', background: 'rgba(85, 130, 243, .7)', lineHeight: 1.5 }
  const siderStyle:ILayoutProps['style'] = { color: '#fff', lineHeight: '120px', background: 'rgba(85, 130, 243, .9)' }
  const contentStyle:ILayoutProps['style'] = {
    minHeight: 120,
    color: '#fff',
    lineHeight: '120px',
    background: 'rgba(85, 130, 243, 1)',
  }

  return (
    <div style={{ margin: '0 12px', textAlign: 'center' }}>
      <Layout>
        <Header style={headerStyle}>Header</Header>
        <Content style={contentStyle}>Content</Content>
        <Footer style={footerStyle}>Footer</Footer>
      </Layout>

      <Layout style={layoutStyle}>
        <Header style={headerStyle}>Header</Header>
        <Layout>
          <Sider style={siderStyle}>Sider</Sider>
          <Content style={contentStyle}>Content</Content>
        </Layout>
        <Footer style={footerStyle}>Footer</Footer>
      </Layout>

      <Layout style={layoutStyle}>
        <Header style={headerStyle}>Header</Header>
        <Layout>
          <Content style={contentStyle}>Content</Content>
          <Sider style={siderStyle}>Sider</Sider>
        </Layout>
        <Footer style={footerStyle}>Footer</Footer>
      </Layout>

      <Layout style={layoutStyle}>
        <Sider style={siderStyle}>Sider</Sider>
        <Layout>
          <Header style={headerStyle}>Header</Header>
          <Content style={contentStyle}>Content</Content>
          <Footer style={footerStyle}>Footer</Footer>
        </Layout>
      </Layout>
    </div>
  )
}

ReactDOM.render(<Demo />, mountNode)

重现问题步骤

期望的结果是什么

1.可访问组件的Props类型
2.组件demo中有完整的typescript定义
3.组件内部typescript定义准确

实际的结果是什么

1.无法访问组件的Props类型
2.组件demo中没有完整的typescript定义
3.组件内部typescript定义不准确

组件库版本号、浏览器信息

组件库与浏览器均为最新版本

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants