前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >【愚公系列】2022年05月 vue3系列 配置自动打开浏览器和自动模板

【愚公系列】2022年05月 vue3系列 配置自动打开浏览器和自动模板

作者头像
愚公搬代码
发布2022-05-18 09:22:17
3940
发布2022-05-18 09:22:17
举报
文章被收录于专栏:历史专栏

文章目录

一、配置自动打开浏览器

vue.config.js

代码语言:javascript
复制
module.exports = {
  devServer: {
    open: true // 是否自动启动浏览器
  }
};
在这里插入图片描述
在这里插入图片描述

二、自动模板

点击文件=》首选项=》代码片段=》vue.json

在这里插入图片描述
在这里插入图片描述
代码语言:javascript
复制
{
	// 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": [
		"",
		"",
		"export default {",
		"  data() {",
		"    return {\n",
		"    }",
		"  },",
		"  mounted(){\n",
		"  },",
		"  computed:{\n",
		"  },",
		"  methods:{\n",
		"  },",
		"}",
		"",
		"\n",
		"",
		"$2"
	  ],
	  "description": "Log output to console"
	},
	"Print to v3": {
	  "prefix": "vue3",
	  "body": [
		"",
		"",
		"export default {",
		"  components: {\n",
		"  },",
		"  props: {\n",
		"  },",
		"  setup(props, context) {\n",
		"  }",
		"}",
		"",
		"\n",
		"",
	  ],
	  "description": "Log output to console"
	},
	"Print to setup": {
	  "prefix": "setup",
	  "body": [
		"",
		"\n",
		"",
		"\n",
		"",
	  ],
	  "description": "Log output to console"
	}
  }

在vue文件中输入vue就会选项

在这里插入图片描述
在这里插入图片描述

选择vue3出现下面代码片段

代码语言:javascript
复制
export default {
  components: {

  },
  props: {

  },
  setup(props, context) {

  }
}
在这里插入图片描述
在这里插入图片描述
本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2022/05/17 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 文章目录
  • 一、配置自动打开浏览器
  • 二、自动模板
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档