Questions tagged [mithril.js]

Mithril.js is a client-side MVC framework.

Mithril.js is a client-side MVC framework - a tool to organize code in a way that is easy to think about and to maintain.

Some features include

  • Safe-by-default templates
  • Hierarchical MVC via components
  • Virtual DOM diffing and compilable templates
  • Intelligent auto-redrawing system

Official page and resources: http://mithril.js.org/

260 questions
3
votes
1 answer

Mithril component not updating when route changes

I am creating my personal website/blog as a a single page application using Mithril.js. All pages and blog posts on my website are rendered using Page and Post components, and the correct page is loaded based on the :slug in the URL. The problem I…
evanrelf
  • 303
  • 3
  • 12
3
votes
1 answer

Mithril simple example demands ReactJS

Just trying to do simple example using JSX without webpack and npm.
3
votes
1 answer

Mithril.js: What does "Component template must return a virtual element, not an array, string, etc." mean?

Trying out mithril.js for the first time, so apologies if this is simple question. I'm getting an error message, Component template must return a virtual element, not an array, string, etc. when I nest a map() derived components in another…
jgwl
  • 305
  • 1
  • 13
3
votes
1 answer

Javascript - Mithril nested components

I am building a dashboard using mithril components. The dashboard consist of generic widget components which nest more specific components such as twitter widgets, sales widgets etc. The generic widget is agnostic of the nested component. Now I have…
3
votes
1 answer

Login page redirect new page if sucess

My application uses Mithril.js and Play Framework. I would like to know if there is a (good) way to divide my application between mithril and play. I would like to have play renders a login.html, this login.html will only contain only the import of…
GermainGum
  • 1,349
  • 3
  • 15
  • 40
3
votes
2 answers

Mount not working inside controller vm

I'm honestly not sure why this is not working. Seems to be a pretty standard operation. It is not mounting the component, is not throwing an error, and not running the function directly after it. All happing in…
swade
  • 668
  • 2
  • 7
  • 15
3
votes
1 answer

Using Mithril to generate HTML for a Bootstrap Accordion

Have a problem using Mithril to generate a functioning Bootstrap accordion. When I write this HTML manually the accordion works ok.
PeterW
  • 65
  • 3
3
votes
1 answer

Updating/redrawing Mithril component views with external state changes (Redux)

New to Mithril but really want to like it. I coded demo app a few weeks ago using React and Redux for state management. I also used a library to connect the two, but it all works and can be seen at http://curiousercreative.com/demos/bankDemo/. After…
curiouser
  • 970
  • 2
  • 12
  • 22
3
votes
2 answers

Perfomance issues with large number of elements in Mithril.js

My app has a sort- and filterable list and a few inputs and checkboxes so far. The problem appears if the list has more than 500 items, then every every element with user input (checkboxes, input fields, menus) start to have a lag around half a…
3
votes
1 answer

Delegating Draggable Events to Parent Elements

I have draggable li elements nested in a ul in turn nested in a div, as seen below:
// some stuff here
  • Stuff I want to drag and drop to…
plsnoban
  • 351
  • 5
  • 17
3
votes
2 answers

Horizontal space between bootstrap buttons using mithril.js

When using pure bootstrap there is a small horizontal space between buttons.
3
votes
2 answers

avoid global redraw on modular view model

how would I be able to avoid a global redraw = call to the main view function while changing the view of a submodule like in the main Module view method: m("body", [ m("#head", {...}), Menu.show(this), …
3
votes
1 answer

How can I unit test a model using m.request in Mithril?

I am trying to unit test a Mithril model using m.request in a DOM-less environment. I have this test working as an integration test in a browser environment using the browser's XMLHttpRequest, but would like the option to run this in isolation. I…
jrh
  • 4,101
  • 2
  • 22
  • 27
3
votes
1 answer

Using jQuery UI functions with Mithril

I am new to the Mithril JS framework and I love its rendering performance. It being light-weight is a plus, but I would like to use jQuery UI so that I can benefit from some of its functionality such as the draggable interaction. From my…
Adrian
  • 45
  • 4
2
votes
1 answer

Getting a NodeList of the HTML tags in Mithril

Is there a way of having a NodeList of the HTML tags in Mithril? I need to get the width of the blocks. Something like that on vanilla js: const blocks = Array.from(document.querySelectorAll('.blocks')); const styles = blocks .map((item) =>…
vasilek_
  • 31
  • 1
  • 2
1
2
3
17 18