Vueno
.html 文件处理为.vue 文件
贡献者
使用
在VSC中打开任何.html 后缀文件,修改并保存,将自动转换为.vue 的单文件组件
例如有文件test.html 内容如下:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<style>
div {
color: red
}
</style>
</head>
<body>
<script>
console.log('Eno Yao')
</script>
<p>Eno Yao</p>
<p>Hello World</p>
<script>
console.log('Hello World')
</script>
</body>
</html>
保存文件后,将在同目录下生成test.html.vue 文件,内容如下
<template>
<div>
<p>Eno Yao</p>
<p>Hello World</p>
</div>
</template>
<script>
export default {};
</script>
<style scoped>
div {
color: red;
}
</style>
| |