Skip to content

Instantly share code, notes, and snippets.

Avatar

Evan You yyx990803

View GitHub Profile
View esm.html
<script type="module">
import Vue from 'https://unpkg.com/vue/dist/vue.esm.browser.js'
new Vue({
// ...
})
</script>
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>
<my-component>
<template v-slot:[slotName]>
Dynamic slot name
</template>
View slot-example.html
<my-component>
<template v-slot:header>
<p>Header</p>
</template>
<template v-slot:item="{ data }">
<h2>{{ data.title }}</h2>
<p>{{ data.text }}</p>
</template>
View syntax.vue
<SomeComponent>
<template #header>
<div>Header message</div>
</template>
<template #item="{ item }">
<div class="item">{{ item.text }}</div>
</template>
<template #footer>
@yyx990803
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 }}
</foo>
<!-- default slot with element -->
<foo ()="foo">
<div>
@yyx990803
yyx990803 / pre-commit.sh
Last active Oct 22, 2018
pre-commit hook for Vue.js
View pre-commit.sh
#!/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
fi
View example-changelog.md

3.0.0-rc.4

cli

  • New Features

    • ...
    • ...
  • Bug Fixes

View vuex.html
<script src="https://npmcdn.com/vue@next/dist/vue.js"></script>
<script src="https://npmcdn.com/vuex@next"></script>
<div id="app">
{{ count }}
<button @click="increment"> + </button>
<button @click="decrement"> - </button>
</div>
<script>
@yyx990803
yyx990803 / note.md
Last active Apr 27, 2018
Why we are no longer hosting community translations
View note.md

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. translation.vuejs.org) where we list all community contributed translations.