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
2
votes
2 answers

Error `Template parameter names *must* be separated`

I am using mithril.js in frontend application and backend application is running on ipv6 environment. Calling post ajax request to backend using mithril.js. async post(url, body = {}) { return new Promise((resolve, reject) => { …
Himanshu Patel
  • 213
  • 2
  • 13
2
votes
2 answers

Event capture on mithril?

is there no event capturing? Id like to force event handling order, in autocomplete component, onblur event fires before onclick on item in a list, causing the list to toggle twice and so remaining visible after flickering.
janat08
  • 1,725
  • 2
  • 16
  • 27
2
votes
2 answers

How to escape infinite loop when loading from a file in a layout component?

I am building a personal webpage with Mithril JS by following the simple application example in https://mithril.js.org/simple-application.html and the layout example in http://lhorie.github.io/mithril-blog/better-templates-with-fp.html. But I keep…
Lask3r
  • 137
  • 1
  • 1
  • 6
2
votes
1 answer

Build up some UI with mithril.js and jsx

I'm new to javascript and its ecosystem. I'm trying to build some components using mithril.js. My goal is to have a component that shows some properties and provides a couple of button for each of them. Just to learn about mithril.js and jsx. Here…
Francesco
  • 1,742
  • 5
  • 44
  • 78
2
votes
1 answer

embedding a phaser 3 game into an existing mithril website

I have been trying to get phaser 3 to work in an existing mithril website. All of the existing phaser 3 examples seem to work 'by magic'. There is no javascript code that mounts the phaser game into your DOM. Searching gets me nowhere. Even the…
Jim Hessin
  • 137
  • 2
  • 11
2
votes
1 answer

Creating new elements at runtime using Mithril

Using Mithril, a Javascript framework, I am trying to add new elements after the initial body has been created and rendered. Here is my problem in it's most basic form: let divArray = []; let newDivButton = m('button', { onclick: ()=> { …
JacobP
  • 43
  • 4
2
votes
2 answers

Dynamically adding routes and components in Mithril

Mithril's website states: You can only have one m.route call per application. So I was almost able to do a work around with code splitting. But my application is only aware of the first-level components for a given URL which it utilizes the async…
Modular
  • 6,440
  • 2
  • 35
  • 38
2
votes
1 answer

How to detect current url inside a view method

I am creating a form for an entity that needs to have some fields omitted when creating the entity, compared to when editing it. How do I do this? Should I have one form and omit the fields when building a form for create? Or is there a another…
user3791372
  • 4,445
  • 6
  • 44
  • 78
2
votes
1 answer

Preventing redraw in Mithril

I've made a simple FlashMessage model for mithril and I'm using it to display feedback for forms (e.g. successfully saved): // the model var FlashMessage = { messages: [], clear: function() { FlashMessage.messages = []; }, …
user3791372
  • 4,445
  • 6
  • 44
  • 78
2
votes
1 answer

Mithril: difference between vnode.attrs and vnode.state

What is the difference between vnode.attrs.value and vnode.state.value when creating new components in Mithril?
Motassem Jalal
  • 1,254
  • 1
  • 22
  • 46
2
votes
1 answer

how to perform mithril routing with children (subcomponents)

I am writing an application using mithril and react. I need to define the routes, and so far this is what I have come up with m.route(root, '/', { '/': LoginComponent, '/login': LoginComponent, '/Login/Email': LoginEmailComponent, …
tmp dev
  • 8,043
  • 16
  • 53
  • 108
2
votes
1 answer

mithril requires 'mithril' to be imported

I am writing a simple Mithril component, given below is the code var m = require("mithril") var MyComponent = { view() { return ; } }; export default MyComponent; My problem is that in this scenario I…
tmp dev
  • 8,043
  • 16
  • 53
  • 108
2
votes
1 answer

Implementing correct CSP rules for CDN

I'm currently undertaking a introduction to mobile webapplications development course at my university and am struggling setting up bootstrap on my mithril application. I've previously set up bootstrap fine on "normal" web applications, but I'm…
geostocker
  • 1,190
  • 2
  • 17
  • 29
2
votes
1 answer

Mithril: render one DOM element bases on another

I have a fixed height div (body) containing two children, the header and the content. The header's height is changing on click of a button, and the content's height should be auto adjusting to fill the rest of the body. Now the problem is, the new…
Jasmin_W
  • 101
  • 6
2
votes
3 answers

TypeScript 2 TSX preserve and noimplicitany error TS2602: the global type 'JSX.Element' does not exist

I'm using TypeScript 2 and TSX with the preserve (not React) setting and with "noImplicitAny" enabled: "noImplicitAny": true, "jsx": "preserve" The problem is, I keep getting this error when trying to build a simple TSX file: error TS2602: JSX…
Christopher Davies
  • 4,461
  • 2
  • 34
  • 33
1 2
3
17 18