npm install @wrium/wrium
import { createApp, ref } from '@wrium/wrium';
Wrium ships as both an ES module and a UMD build, so import and
require() both work out of the box, and the plugins are published as
their own subpaths:
import { HtmlPlugin } from '@wrium/wrium/plugins/html.js';
import { PasswordStrengthPlugin } from '@wrium/wrium/plugins/password-strength.js';
import { DraggablePlugin } from '@wrium/wrium/plugins/draggable.js';
Wrium is designed to be dropped directly into a page with zero tooling.
Point a <script type="module"> straight at the built file:
<script type="module">
import { createApp, ref } from './node_modules/wrium/dist/1.0.0/wrium.es.js';
</script>
<!DOCTYPE html>
<html lang="en">
<head>
<title>Wrium Counter</title>
</head>
<body>
<div id="app">
<h1>{{ title }}</h1>
<p>Current count: {{ count }}</p>
<button @click="increment">Increment</button>
<button @click="decrement">Decrement</button>
</div>
<script type="module">
import { createApp, ref } from '@wrium/wrium';
createApp(() => {
const title = ref('Counter App');
const count = ref(0);
const increment = () => count.value++;
const decrement = () => count.value--;
return { title, count, increment, decrement };
}).mount('#app');
</script>
</body>
</html>
Continue with Core Concepts.