- Preferences>Browse Packages>SublimeTmpl>templates 新建vue.tmpl
<template> <div> <header-component/> <div>this is template body</div> <other-component/> </div> </template> <style> body{ background-color: #ff0000; } </style> <script> import HeaderComponent from './components/header.vue' import OtherComponent from './components/other.vue' export default{ data(){ return{ msg:'hello vue' } }, components:{ 'other-component':OtherComponent, HeaderComponent } } </script>
2. Preferences>Package settings> sublime Tmpl>Commands default,打开Default.sublime-commands, 复制粘贴:
,{ "caption": "Tmpl: Create vue", "command": "sublime_tmpl", "args": {"type": "vue"} }
3. 添加快捷键Preferences>Package settings>sublime Tmpl>key Bindings-Users,打开Default.sublime-commands,复制粘贴以下配置:
,{ "keys": ["ctrl+alt+e"], "command": "sublime_tmpl", "args": {"type": "vue"}, "context": [{"key": "sublime_tmpl.vue"}] }
sublime 添加vue模板
最新推荐文章于 2021-12-09 16:32:48 发布