sublime text3--创建vue模板
2018-01-30 本文已影响999人
飞菲fly
1.安装SublimeTmpl模板
ctrl+shift+p
图片.png
输入sublimeTmpl,安装sublimeTmpl模块;
2.创建Vue模板
点开Preferences选择Browse Packages...,打开SublimeTmpl文件下的templates文件夹,新建一个vue.tmpl;
![](https://img.haomeiwen.com/i1666676/21c46dd7f0b63b3b.png)
![](https://img.haomeiwen.com/i1666676/b0fe22ebb5becc18.png)
vue.tmpl
<template lang="html">
</template>
<script>
export default {
}
</script>
<style lang="scss">
</style>
3.配置
Preferences——Package Settings——SublimeTmpl——commands-Default(在这个文件中添下面一段代码)
,
{
"caption": "Tmpl: Create vue", "command": "sublime_tmpl",
"args": {"type": "vue"}
}
![](https://img.haomeiwen.com/i1666676/d23c832e15939b6b.png)
4.添加快捷键
Preferences——Package Settings——SublimeTmpl——key Bindings-Default
,
{
"keys": ["ctrl+alt+e"], "command": "sublime_tmpl",
"args": {"type": "vue"}, "context": [{"key": "sublime_tmpl.vue"}]
}
![](https://img.haomeiwen.com/i1666676/1f81afe3a55e6337.png)
使用ctrl+alt+e就可以建立Vue模板了;高亮插件自己搜索安装。
![](https://img.haomeiwen.com/i1666676/ea156681666cefc1.png)