Skip to content

Coding-Dodo/OWL2-JavaScript-Project-Starter

Repository files navigation

OWL 2 Javascript Project Starter

This repo is an example on how to start a real project with the Odoo OWL framework in version 2.

Deploy on Netlify

Features

  • OWL v2.0.5
  • Javascript
  • Vite
  • TailwindCSS

Installation

This repo is a "template repository". It means you can quickly create repositories based on this one, without it being a fork.

Otherwise, you may clone it:

git clone https://github.com/Coding-Dodo/OWL2-JavaScript-Project-Starter.git

Install dependencies:

pnpm i

Dev with HMR:

pnpm dev

Production build

pnpm build

Preview Production build

pnpm preview

Run tests

pnpm test

Components

It is expected to create components in one file, following this convention:

import { Component, useState, tags } from "@odoo/owl";

const APP_TEMPLATE = tags.xml/*xml*/ `
<div t-name="App" class="" t-on-click="update">
  Hello <t t-esc="state.text"/>
</div>
`;

export class App extends Component {
  static template = APP_TEMPLATE;
  state = useState({ text: "Owl" });
  update() {
    this.state.text = this.state.text === "Owl" ? "World" : "Owl";
  }
}

See also

If your are searching for OWL version 1 project starter with Tailwind and PostCSS:

https://github.com/Coding-Dodo/OWL-JavaScript-Tailwind-Project-Starter

About

OWL v2 JavaScript Project with Vite and TailwindCSS

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy