mirror of
https://github.com/django-components/django-components.git
synced 2025-08-31 03:07:19 +00:00
refactor: change component typing from generics to class attributes (#1138)
This commit is contained in:
parent
912d8e8074
commit
b49002b545
25 changed files with 2451 additions and 610 deletions
|
@ -85,10 +85,10 @@ class TestComponentMediaCache:
|
|||
<div>Template only component</div>
|
||||
"""
|
||||
|
||||
def get_js_data(self):
|
||||
def get_js_data(self, args, kwargs, slots, context):
|
||||
return {}
|
||||
|
||||
def get_css_data(self):
|
||||
def get_css_data(self, args, kwargs, slots, context):
|
||||
return {}
|
||||
|
||||
@register("test_media_no_vars")
|
||||
|
@ -100,10 +100,10 @@ class TestComponentMediaCache:
|
|||
js = "console.log('Hello from JS');"
|
||||
css = ".novars-component { color: blue; }"
|
||||
|
||||
def get_js_data(self):
|
||||
def get_js_data(self, args, kwargs, slots, context):
|
||||
return {}
|
||||
|
||||
def get_css_data(self):
|
||||
def get_css_data(self, args, kwargs, slots, context):
|
||||
return {}
|
||||
|
||||
class TestMediaAndVarsComponent(Component):
|
||||
|
@ -114,10 +114,10 @@ class TestComponentMediaCache:
|
|||
js = "console.log('Hello from full component');"
|
||||
css = ".full-component { color: blue; }"
|
||||
|
||||
def get_js_data(self):
|
||||
def get_js_data(self, args, kwargs, slots, context):
|
||||
return {"message": "Hello"}
|
||||
|
||||
def get_css_data(self):
|
||||
def get_css_data(self, args, kwargs, slots, context):
|
||||
return {"color": "blue"}
|
||||
|
||||
# Register our test cache
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue