Skip to content

Instantly share code, notes, and snippets.


Evan You yyx990803

View GitHub Profile
View esm.html
<script type="module">
import Vue from ''
new Vue({
// ...
View observable.js
const reactiveState = Vue.observable({
count: 0
View dynamic-directive-argument.html
<div v-bind:[attr]="value"></div>
<div :[attr]="value"></div>
<button v-on:[event]="handler"></button>
<button @[event]="handler"></button>
<template v-slot:[slotName]>
Dynamic slot name
View slot-example.html
<template v-slot:header>
<template v-slot:item="{ data }">
<h2>{{ data.title }}</h2>
<p>{{ data.text }}</p>
View syntax.vue
<template #header>
<div>Header message</div>
<template #item="{ item }">
<div class="item">{{ item.text }}</div>
<template #footer>
yyx990803 / slot-alias.vue
Last active Jan 14, 2019
Comparison of `slot-props`/`()` vs `slot-scope`
View slot-alias.vue
Proposed new usage - `()` is a shorthand of `slot-props`.
<!-- default slot with just text -->
<foo ()="foo">
{{ foo }}
<!-- default slot with element -->
<foo ()="foo">
yyx990803 /
Last active Oct 22, 2018
pre-commit hook for Vue.js
#!/usr/bin/env bash
# get files to be linted
FILES=$(git diff --cached --name-only | grep -E '^src|^test/unit/specs|^test/e2e')
# lint them if any
if [[ $FILES ]]; then
./node_modules/.bin/eslint $FILES



  • New Features

    • ...
    • ...
  • Bug Fixes

View vuex.html
<script src=""></script>
<script src=""></script>
<div id="app">
{{ count }}
<button @click="increment"> + </button>
<button @click="decrement"> - </button>
yyx990803 /
Last active Apr 27, 2018
Why we are no longer hosting community translations

We understand that it is great for developers to be able to read documentations in their native languages, and translations of our docs are still valued contributions. However, we are no longer hosting translations in the project repos because:

  • By hosting them in the offcial repo, we have a responsibility to keep them up-to-date and in sync. However, initial contributors of a translation sometimes stop maintaining the translation, and for some languages we don't have anyone on the core team that can review or update them.

  • Updating multiple languages whenever new changes are introduced is a chore that slows down pace of development considerably.

In the future, we are limiting officially hosted langauges to English only.

You are still more than welcome to fork and translate the documentations - you just have to host them on your own. We will likely have a dedicated page (e.g. where we list all community contributed translations.