JSFiddle - React, Tailwind, and code Playground

by lega911

HTML

<script src="https://angularlight.org/bin/alight_0.14.last.min.js"></script>
<button >{{xx}}</button>
<button >{{yy}}</button>

<div al-if="error" class="error" @mouseover="error.el.className='highlight'" @mouseout="error.el.className=''">
  <b>{{error.title}}</b>
  <pre>{{error.stack}}</pre>
</div>

CSS

.error {
  border: 1px solid red;
  background: #FEE;
  margin-top: 20px;
}

.highlight {
  border: 3px solid red;  
}

JavaScript

var app = {
	get xx() { some.error() },
  get yy() { return 'yy' },
};

alight.exceptionHandler = function(e, title, locals) {
	app.error = {title: title, stack: e.stack, el: locals.element.parentNode};
  console.log(locals);
};

alight('body', app);