Skip to content
This repository has been archived by the owner on Nov 18, 2019. It is now read-only.
pjackson3 edited this page Jun 14, 2019 · 2 revisions

Vident

Vident is a small and lightweight jQuery component plugin. The name of this library comes from the latin word for "they see". It uses mustache for templating. The main philosophy behind this library is that the view layer should not contain any logic. It does have the option of having a "prerender" function in components so that people who do need to do some logic at render can do so.

Example

/* index.html */
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<div id="app">
</div>
<script src="path/to/compiled/script.js">
</script>
</body>
</html>
// main.js
import jQuery from "jquery"
import { setup } from "vident"
import template from "./template.mustache"

const $ = setup(jQuery)

const component = $().createComponent({
  template: template
})

$("#app").renderComponent({
  component: component,
  data: {data: "Hello World!"}
})
/* template.mustache */
<h1>{{data}}</h1>

This will render the component onto the div with an id of app

Contents

Clone this wiki locally