This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<div class="bg-light" style="height: 300px;"> | |
<button @contextmenu.prevent="contextmenu">hi</button> | |
<button @contextmenu.prevent="contextmenu">bye</button> | |
<div v-if="show" class="contextmenu" @contextmenu.stop.prevent="recontextmenu" @click="show = false"> | |
<div class="modal-dialog m-0" :style="style"> | |
<div class="modal-content"> | |
{{ text }} | |
</div> | |
</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Rect from "./rect"; | |
const rect = new Rect({ x: 100, y: 200, width: 300, height: 400 }); | |
describe("Rect", () => { | |
describe("Left Top", () => { | |
it("左上に動かしたら拡大する", () => { | |
const b = rect.moveLeftTop({ x: 50, y: 50 }); | |
expect(b).toEqual({ x: 50, y: 50, width: 350, height: 550 }); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="ja"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
<style id="style-main"></style> | |
<title>Document</title> | |
</head> | |
<body> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const _ = require("lodash"); | |
const a = [1, 2, 3]; | |
console.info([...a] == [...a]); //=> false | |
console.info(_.isEqual([...a], [...a])); //=> true | |
const o = { | |
id: 1, | |
name: "John Doe" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const _ = require("lodash"); | |
const xs = [ | |
{ | |
id: 1, | |
name: "John Doe" | |
}, | |
{ | |
id: 2, | |
name: "Jane Doe" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<div class="chart-bar" :style="gridColumn"> | |
<div class="chart-bar-bar" :style="{ background: color }" /> | |
<slot></slot> | |
</div> | |
</template> | |
<script lang="ts"> | |
import { Prop, Component, Vue } from "vue-property-decorator"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import axios from "axios"; | |
// application/json | |
axios.post("http://localhost:3000/", { | |
a: 1, | |
b: "hello", | |
c: new Date() | |
}); | |
// application/x-www-form-urlencoded |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<div> | |
<div v-for="(message, i) in messages" :key="i"> | |
<input type="text" :value="message" @input="e => input(i, e.target.value)" /> | |
</div> | |
</div> | |
</template> | |
<script lang="ts"> | |
import { Prop, Component, Vue } from "vue-property-decorator"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<div> | |
<pre>{{ tasks }}</pre> | |
<v-task-list-input v-model="tasks" /> | |
</div> | |
</template> | |
<script lang="ts"> | |
import { Component, Vue } from "vue-property-decorator"; | |
import VueTaskListInput from "../components/VueTaskListInput.vue"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"Scaffolding typescript": { | |
"prefix": "typescript scaffold", | |
"body": [ | |
"<script lang=\"ts\">", | |
"import { Prop, Component, Vue } from \"vue-property-decorator\";", | |
"", | |
"@Component", | |
"export default class $TM_FILENAME_BASE extends Vue {", | |
" $0", |