admin 管理员组文章数量: 1086019
文章目录
- 一、配置自动打开浏览器
- 二、自动模板
一、配置自动打开浏览器
vue.config.js
module.exports = {
devServer: {
open: true // 是否自动启动浏览器
},
lintOnSave: false,//禁止eslink
};
二、自动模板
点击文件=》首选项=》代码片段=》vue.json
{
// Place your snippets for vue-html here. Each snippet is defined under a snippet name and has a prefix, body and
// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the
// same ids are connected.
// Example:
// "Print to console": {
// "prefix": "log",
// "body": [
// "console.log('$1');",
// "$2"
// ],
// "description": "Log output to console"
// }
"Print to v2": {
"prefix": "vue2",
"body": [
"<template>",
" <div>\n",
" </div>",
"</template>",
"<script>",
"export default {",
" data() {",
" return {\n",
" }",
" },",
" mounted(){\n",
" },",
" computed:{\n",
" },",
" methods:{\n",
" },",
"}",
"</script>",
"<style scoped>\n",
"</style>",
"$2"
],
"description": "Log output to console"
},
"Print to v3": {
"prefix": "vue3",
"body": [
"<template>",
" <div></div>",
"</template>",
"<script>",
"export default {",
" components: {\n",
" },",
" props: {\n",
" },",
" setup(props, context) {\n",
" }",
"}",
"</script>",
"<style scoped>\n",
"</style>",
],
"description": "Log output to console"
},
"Print to setup": {
"prefix": "setup",
"body": [
"<template>",
" <div></div>",
"</template>",
"<script setup>\n",
"</script>",
"<style scoped>\n",
"</style>",
],
"description": "Log output to console"
}
}
在vue文件中输入vue就会选项
选择vue3出现下面代码片段
<template>
<div></div>
</template>
<script>
export default {
components: {
},
props: {
},
setup(props, context) {
}
}
</script>
<style scoped>
</style>
版权声明:本文标题:【愚公系列】2022年05月 vue3系列 配置自动打开浏览器和自动模板 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://roclinux.cn/b/1737922625a1896726.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论