aio components custom attributes not passed down
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- Python
- Star
- 24.4k
- Fork
- 2.3k
- Merge trung bình
- 2 ngày 7 giờ
- Pull request đã merge (30 ngày)
- 13
Mô tả
Describe your context
dash 2.3.1
dash-core-components 2.0.0
dash-html-components 2.0.0
dash-labs 1.0.3
dash-table 5.0.0
Following six line demonstrator works with static layout:
app.layout = layout()
but fails to initialise when invoked dynamically:
app.layout = layout
The issue is with the method simple_clone(), in dash.py/L566. The Dash layout clone method
fails to pass in the value total_items=100. This is significant problem since the sub-classing the
standard Dash components is used extensively when implementing the reusable components
AIO pattern.
class MyDiv(html.Div):
def __init__(self, children=None, className='some-class', total_items=None, page_size=10):
# Fails with TypeError: unsupported operand type(s) for /: 'NoneType' and 'int'
pages = total_items / page_size
print(pages)
super().__init__(pages, className=className)
def layout():
return MyDiv(total_items=100)
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Bắt đầu trong dash.py quanh L566 và kiểm tra simple_clone() bằng ví dụ MyDiv được cung cấp. So sánh layout() tĩnh với layout động và xác minh rằng thuộc tính tùy chỉnh total_items=100 được giữ lại để layout động khởi tạo mà không gặp TypeError đã nêu.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- python
- Lĩnh vực
- frontend
- Loại issue
- Lỗi
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức phù hợp với người mới
- 45/100