瀏覽代碼

fix image component registration

Falko Schindler 1 年之前
父節點
當前提交
b5e1445a59
共有 1 個文件被更改,包括 3 次插入2 次删除
  1. 3 2
      nicegui/elements/image.py

+ 3 - 2
nicegui/elements/image.py

@@ -1,11 +1,11 @@
 from pathlib import Path
 from typing import Union
 
-from nicegui.dependencies import register_component
+from nicegui.dependencies import register_vue_component
 
 from .mixins.source_element import SourceElement
 
-register_component('image', __file__, 'image.js')
+register_vue_component('image', Path(__file__).parent / 'image.js')
 
 
 class Image(SourceElement):
@@ -18,3 +18,4 @@ class Image(SourceElement):
         :param source: the source of the image; can be a URL, local file path or a base64 string
         """
         super().__init__(tag='image', source=source)
+        self.use_component('image')