Merge pull request #8 from scanf/upgrade-imba
Bump Imba version and Misc changes
This commit is contained in:
commit
808fa03d4f
31
README.md
31
README.md
|
@ -1,12 +1,29 @@
|
||||||
# hello-world-imba
|
# Hello World Imba
|
||||||
|
|
||||||
Tiny template for testing out Imba
|
Tiny template for testing out Imba. Click [Use this
|
||||||
|
template](https://github.com/imba/hello-world-imba/generate) on GitHub to
|
||||||
|
create a new repository with this template.
|
||||||
|
|
||||||
## Getting started
|
## Getting started
|
||||||
|
|
||||||
```bash
|
```
|
||||||
# install dependencies
|
git clone https://github.com/imba/hello-world-imba
|
||||||
npm install
|
cd hello-world-imba
|
||||||
# start webpack-dev-server and compiler
|
yarn # npm install
|
||||||
npm run dev
|
```
|
||||||
|
|
||||||
|
You can run the app in two ways, either served via the webpack-dev-server or
|
||||||
|
Express.
|
||||||
|
|
||||||
|
### Webpack
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# start webpack-dev-server and compiler
|
||||||
|
yarn run dev # npm run dev
|
||||||
|
```
|
||||||
|
|
||||||
|
### Server side
|
||||||
|
|
||||||
|
```
|
||||||
|
./node_modules/.bin/imba src/server.imba
|
||||||
```
|
```
|
||||||
|
|
|
@ -84,6 +84,10 @@ ul {
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.completed {
|
||||||
|
text-decoration: line-through;
|
||||||
|
}
|
||||||
|
|
||||||
li {
|
li {
|
||||||
padding: 8px 12px;
|
padding: 8px 12px;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|
|
@ -2,10 +2,10 @@
|
||||||
var store = {
|
var store = {
|
||||||
title: ""
|
title: ""
|
||||||
items: [
|
items: [
|
||||||
{title: "git clone hello-world-imba"}
|
{title: "git clone hello-world-imba", completed: false}
|
||||||
{title: "npm install"}
|
{title: "npm install", completed: false}
|
||||||
{title: "npm run dev"}
|
{title: "npm run dev", completed: false}
|
||||||
{title: "play around"}
|
{title: "play around", completed: false}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -13,6 +13,10 @@ tag App
|
||||||
def addItem
|
def addItem
|
||||||
data:items.push(title: data:title)
|
data:items.push(title: data:title)
|
||||||
data:title = ""
|
data:title = ""
|
||||||
|
|
||||||
|
def completeItem item
|
||||||
|
console.log "clicked,{item:completed}"
|
||||||
|
item:completed = !item:completed
|
||||||
|
|
||||||
def render
|
def render
|
||||||
<self.vbox>
|
<self.vbox>
|
||||||
|
@ -20,7 +24,7 @@ tag App
|
||||||
<input[data:title] placeholder="New..." :keyup.enter.addItem>
|
<input[data:title] placeholder="New..." :keyup.enter.addItem>
|
||||||
<button :tap.addItem> 'Add item'
|
<button :tap.addItem> 'Add item'
|
||||||
<ul> for item in data:items
|
<ul> for item in data:items
|
||||||
<li> item:title
|
<li .completed=item:completed :tap.completeItem(item)> item:title
|
||||||
|
|
||||||
|
|
||||||
Imba.mount <App[store]>
|
Imba.mount <App[store]>
|
Loading…
Reference in New Issue