ex4nicegui icon indicating copy to clipboard operation
ex4nicegui copied to clipboard

Using the ref computed decorator causes some properties to become inaccessible.

Open CrystalWindSnake opened this issue 1 year ago • 0 comments

from dataclasses import dataclass, field
from ex4nicegui import to_ref, ref_computed, deep_ref, Ref

@dataclass
class State:
    todos: Ref = field(default_factory=lambda: deep_ref([]))
    filter_do = to_ref("all")

    @ref_computed
    def filtered_todos(self):
        return 10

s = State()
s.todos.value

error:

AttributeError: 'State' object has no attribute 'todos'

CrystalWindSnake avatar Jul 17 '24 09:07 CrystalWindSnake