Skip to content

Wscats/yox-snippets

Repository files navigation

Yox Snippets for Visual Studio Code

This extension adds Yox Code Snippets into Visual Studio Code.

这个插件基于最新的 Yox 的 API 添加了 Code Snippets。

Download Macketplace Github Page Eno Yao Status

Snippets

Including most of the API of Yox. You can type Yox, choose Yox.component, and press ENTER, then Yox.component(name, {...}) appear on the screen.

插件的 Snippets 如下表格所示,比如你可以键入 Yox 然后按上下键选中 Yox.component 再按 Enter 键,就输入了Yox.component(name, {...})了。

Prefix JavaScript Snippet Content
import import ... from ...
newYox new Yox({...})
addSpecialEvent Yox.dom.addSpecialEvent(name, function (name, listener) {...})
Yox.dom.on Yox.dom.on(node, event, listener)
Yox.dom.off Yox.dom.off(node, event, listener)
Yox.dom.addClass Yox.dom.addClass(node, className)
Yox.dom.removeClass Yox.dom.removeClass(node, className)
Yox.directive Yox.directive(name, { bind: function (node, directive, vnode) {...} })
Yox.component Yox.component(name, {...})
Yox.filter Yox.filter(name, function (value) {...})
Yox.transition Yox.transition(name, { leave: function (node) {...} })
Yox.partial Yox.partial(name, partial)
template template: "..."
name name: "..."
model model: "..."
data data: { key: value }
data data: function () {...}
filters filters: { definition: function (value) {...} }
computed computed: { definition: function (value) {...} }
methods methods: { definition: function (value) {...} }
watchers watchers: { definition: function (value) {...} }
transitions transitions: { enter: function (node) {...} }
directives directives: { definition: function (value) {...} }
events events: { definition: function (value) {...} }
partials partials: {...}
propTypes propTypes: {...}
components components: {...}
beforeCreate beforeCreate: function () {...}
afterCreate afterCreate: function () {...}
beforeMount beforeMount: function () {...}
afterMount afterMount: function () {...}
beforeUpdate beforeUpdate: function () {...}
afterUpdate afterUpdate: function () {...}
beforeDestroy beforeDestroy: function () {...}
afterDestroy afterDestroy: function () {...}
this.$el this.$el.xxx
this.$refs this.$refs.xxx
this.$vnode this.$vnode.xxx
this.$options this.$options.xxx
this.nextTick this.nextTick(task)
this.copy this.copy.(data, deep)
this.toggle this.toggle(keypath)
this.increase this.increase(keypath, step, max)
this.decrease this.decrease(keypath, step, min)
this.append this.append(keypath, item)
this.prepend this.prepend(keypath, item)
this.insert this.insert(keypath, item, index)
this.remove this.remove(keypath, item)
this.removeAt this.removeAt(keypath, index)
console.log console.log(...)
preventDefault event.prevent()
stopPropagation event.stop()

Prefix HTML Snippet Content
template <template>...</template>
{{}} {{ ... }}
{{!--}} {{!-- ... --}}
on-event on-...=...
o-directive o-...=...
transition transition="..."
#if {{#if condition1}}...{{else if condition2}}...{{else}}...{{/if}}
#each {{#each items: item}}...{{/each}}
#partial {{#partial id}}...{{/partial}}
model model="..."
<!-- <!-- ... -->

If you enjoy Yox, you should have it! Waiting for you in our heart!

If you think it's useful, you can leave us a message and like it, Your support is our driving force😀

License

Yox Snippets is released under the MIT.