1、效果图
失败的效果图:
成功的效果图:
2、通过Vue Cli 3 创建vue项目
2.1、步骤如图所示
2.2、涉及的代码关键 其中的方法
<template>
<div id="app">
<img alt="Vue logo" src="./assets/logo.png" />
<HelloWorld msg="Welcome to Your Vue.js App" />
</div>
</template>
<script>
import HelloWorld from "./components/HelloWorld.vue";
export default {
name: "App",
components: {
HelloWorld,
},
created() {
this.a();
},
methods: {
a() {
for (let i = 0; i < 10; i++) {
i = i * 10;
console.log(i);
}
},
},
};
</script>
<style>
#app {
font-family: Avenir, Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-align: center;
color: #2c3e50;
margin-top: 60px;
}
</style>
关键的几个命令
vue create 项目名称
选择eslint版本
npm run serve