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
1
vote
1 answer

JS function result not rendering

I'm trying to render the result of the function renderVerticalCards, but nothing is returned in the DOM, other than the outer divs (those from outside the function call). I have confirmed through the console, that the function is being called, so…
1
vote
1 answer

Using Mithril.js, how can I add options given by an async function, to a previously added select element

I'm trying to add options to a previously created Vnode (select element). The element is returned before the options are available, since they come from an async function. Although I try to set the children upon the callback, that does not change…
1
vote
2 answers

How to use 'value' of input tag in mithril.js

I want to be able to store the value of the text inputted in a variable. I thought something like would work: m('input', { placeholder: 'Type to search...', oninput: () => { alert(this.value) } }) I used alert() just to test it. Whenever an…
Sujit
  • 1,653
  • 2
  • 9
  • 25
1
vote
1 answer

Configuring webpack, babel and mithril.js

I'm trying to get webpack and babel working (I'm new to both). When I run the webpack-dev-server compilation goes fine but content from my imported module isn't working. Here is how I configure my project: // package.json { "name": "wtf", …
Francesco
  • 1,742
  • 5
  • 44
  • 78
1
vote
1 answer

Mithriljs Request body Always empty object

I use mithriljs request like this : submit = e => { e.preventDefault(); const { name } = e.target; console.log({ name: name.value }); m.request({ method: "POST", url:…
yozawiratama
  • 4,209
  • 12
  • 58
  • 106
1
vote
2 answers

Mithril: Wrapping children in an array when using jsx

I'm so close to getting jsx to work with mithril. However, mithril wants you to wrap child elements in an array. It doesn't show a jsx example more than one element deep in the mithril documentation. So a mithril component such as 'use…
K Lovell
  • 45
  • 7
1
vote
2 answers

How to store status in mirthril.js in localStorage?

I'm trying to keep a checkbox's status in localStorage, here is the code with mithril 2.0, but it won't redraw the checkbox after the oninit().
Daniel YC Lin
  • 15,050
  • 18
  • 63
  • 96
1
vote
1 answer

How does one slide in and element on the same "level" of the one sliding out?

I am implementing a simple widget but I am a primer with animations :) How can I avoid the second "screen" to occupy space while transitioning in? Here my fiddle: https://codesandbox.io/s/7w4yw5yq4q As you can see when you click a button on the…
ciaoben
  • 3,138
  • 4
  • 27
  • 42
1
vote
1 answer

Firebase auth with Mithril for login / signup in serverless SPA

Building a serverless Mithril.js Single Page App (SPA) using Firebase for a server-less approach and need to implement oAuth login / signup. Anyone know a suitable library? Can FirebaseUI play nicely with Mithril? I saw the firebasemixin.js for…
c2mw4
  • 13
  • 2
1
vote
1 answer

Django vs Mithril url routing

I am using routing via Mithril. When I route to mysite.com/subpage/item3 via javascript, the static file '/static/app.bundle.js' remains loaded and the subpage html is shown, as expected. m.route(document.body, "/", { "/": Home, "/subpage":…
Shoe Boxam
  • 13
  • 2
1
vote
1 answer

How can I verify that the HTML of a Mithril.js component has been rendered out correctly in unit tests?

I'm trying to test the output of Mithril.js components to programmatically verify that they look how they are intended to. What would be the best way to go about doing this? I'm working with the Jasmine testing framework. I've been looking for a…
GameRoom
  • 15
  • 1
  • 4
1
vote
1 answer

Converting JS to Mithril (using Chartkick)

I'm trying to add Chartkick to an application that uses Mithril. How would I convert the code below to be used with Mithril?

Line Chart