Skip to content

Instantly share code, notes, and snippets.

View slmanju's full-sized avatar
💭
Whatever you are be a good one

Manjula Jayawardana slmanju

💭
Whatever you are be a good one
View GitHub Profile
@slmanju
slmanju / Concurrent.java
Created October 28, 2018 16:35
multithreading with java
public class Concurrent {
public static void main(String[] args) {
Thread runner1 = new Thread(new ThreadRunner("R1"));
Thread runner2 = new Thread(new ThreadRunner("R2"));
runner1.start();
runner2.start();
}
save() {
this.$emit('save-todo', {
title: this.title,
description: this.description
});
this.title = '';
this.description = '';
}
<template>
<div id="todo" class="box">
<div>
<label for="title">Title</label>
<input type="text" id="title" v-model="title" />
</div>
<div>
<label for="description">Description</label>
<input type="text" id="description" v-model="description" />
</div>
<template>
<div id="todo-list">
<ul>
<li v-for="todo in todos">{{ todo }}</li>
</ul>
</div>
</template>
<script>
export default {
<template>
<div id="app">
<div>
<h3>Todo List</h3>
<todo/>
<todo-list v-bind:todos="todos"></todo-list>
</div>
</div>
</template>
<template>
<div id="todo-list">
<ul>
<li v-for="todo in todos">{{ todo }}</li>
</ul>
</div>
</template>
<script>
export default {
<template>
<div id="app">
<div>
<h3>Todo List</h3>
<todo/>
<todo-list></todo-list>
</div>
</div>
</template>
<template>
<div id="todo-list">
<ul>
<li>Todo 1</li>
<li>Todo 2</li>
<li>Todo 3</li>
</ul>
</div>
</template>
<template>
<div id="todo">
<label for="newtodo">Todo</label>
<input type="text" id="newtodo" />
</div>
</template>
<script>
export default {
<template>
<div id="app">
<div>
<h3>Todo List</h3>
<div id="todo">
<label for="newtodo">Todo</label>
<input type="text" id="newtodo" />
</div>
<div id="todo-list">
<ul>