Skip to content

Instantly share code, notes, and snippets.

<template>
<img :src="logoURL" :alt="logoCaption" width="200" height="200" />
<h1>{{ title }}</h1>
<h2>Add a new task</h2>
<span>You have {{ allTasks }} {{ allTasks > 1 ? 'tasks' : 'task' }} at the moment</span>
<div>
<input type="text"
v-model="newTask"
<template>
<h1>{{ title }}</h1>
<h2>Add a new task</h2>
<div>
<input type="text"
v-model="newTask"
placeholder="Add a new task"
>
@SitePointEditors
SitePointEditors / dom-helper.js
Created March 28, 2017 09:56 — forked from m3g4p0p/dom-helper.js
Mini jQuery, sort of.
/**
* A collection of helper prototype for everyday DOM traversal, manipulation,
* and event binding. Sort of a minimalist jQuery, mainly for demonstration
* purposes. MIT @ m3g4p0p
*/
window.$ = (function (undefined) {
/**
* Duration constants
* @type {Object}
<template>
<h1>{{ title }}</h1>
<ul>
<li v-for="task in tasks" :key="task.id">
{{task.id}}. {{ task.name }}
</li>
</ul>
</template>
<template>
<h1>{{ title }}</h1>
<ul>
<li v-for="task in tasks" :key="task.id">
{{ task.id }}. {{ task.name }}
<div v-if="task.finished">
<button>Delete task</button>
</div>
<template>
<h1>{{ title }}</h1>
<h2>Add a new task</h2>
<div>
<input type="text"
v-model="newTask"
placeholder="Add a new task"
>
<template>
<h1>{{ title }}</h1>
<h2>Add a new task</h2>
<div>
<input type="text"
v-model="newTask"
placeholder="Add a new task"
>
<template>
<h1>{{ title }}</h1>
<h2>Add a new task</h2>
<span>You have {{ allTasks }} {{ allTasks > 1 ? 'tasks' : 'task' }} at the moment</span>
<div>
<input type="text"
v-model="newTask"
placeholder="Add a new task"
<template>
<img :src="logoURL" :alt="logoCaption" width="200" height="200" />
<h1>{{ title }}</h1>
<h2>Add a new task</h2>
<span>You have {{ allTasks }} {{ allTasks > 1 ? 'tasks' : 'task' }} at the moment</span>
<div>
<input type="text"
v-model="newTask"
<template>
<img :src="logoURL" :alt="logoCaption" width="200" height="200" />
<h1>{{ title }}</h1>
<h2>Add a new task</h2>
<span>You have {{ allTasks }} {{ allTasks > 1 ? 'tasks' : 'task' }} at the moment</span>
<div>
<input type="text"
v-model="newTask"