liriliri / luna

UI library
https://luna.liriliri.io
MIT License
251 stars 22 forks source link

console.log(Element) output issue #1

Closed X7md closed 3 years ago

X7md commented 3 years ago

issue

when I try to log element there is some extra code log with element

      const container = document.getElementById('container')
      const ele = document.createElement('div');
      const console = new LunaConsole(ele)
      console.log(container)

image

not sure but I try debugging and found this:

image

full code:

<!DOCTYPE html>
<html>
<head>
    <link rel="stylesheet" href="//cdn.jsdelivr.net/npm/luna-object-viewer/luna-object-viewer.css" />
    <link rel="stylesheet" href="//cdn.jsdelivr.net/npm/luna-console/luna-console.css" />
</head>
<body>
    <div id="container">
    </div>

    <!--lib-->
    <script src="//cdn.jsdelivr.net/npm/luna-object-viewer/luna-object-viewer.js"></script>
    <script src="//cdn.jsdelivr.net/npm/luna-console/luna-console.js"></script>
    <!--lib-->

    <script>
      const container = document.getElementById('container')
      const ele = document.createElement('div');
      const console = new LunaConsole(container)
      console.log(container)
    </script>
</body>
</html>
surunzi commented 3 years ago

I forgot to delete some debugging code.

erasec1994 commented 3 years ago

😁

---Original--- From: @.> Date: Tue, Aug 31, 2021 19:56 PM To: @.>; Cc: @.***>; Subject: Re: [liriliri/luna] console.log(Element) output issue (#1)

I forgot to delete some debugging code.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

X7md commented 3 years ago

It's like console.log doesn't work with style element

const container = document.getElementById('container')
      const ele = document.createElement('style');
      const console = new LunaConsole(container);
      console.log(ele);
surunzi commented 3 years ago

It's like console.log doesn't work with style element

const container = document.getElementById('container')
      const ele = document.createElement('style');
      const console = new LunaConsole(container);
      console.log(ele);

Fixed in luna-console@0.2.1

X7md commented 3 years ago

Nice 💖