Install, configure learning VUE configuration:

  1. Create a new VUE project and select the configuration manually:

    yarn global add vue
    yarn global add @vue/cli
    vue create hello-world
    Copy the code
  2. Manual configuration options:


Full and incomplete vUE

  • Vue full version hascompileThe incomplete version does not, soThe incomplete version is 40% smaller.
  • The full version is available in HTML,templateTo write the file, the incomplete version can only be passedhDelta function.
  • The name of the full version of CDN introduction isvue.js, the name of the incomplete version of CDN introduction isvue.runtime.js
  • Generally speaking, weWrite template directly to the vue fileAnd then letvue-loaderConverted intohFunction version

How to write vUE single file components?

Template tags write HTML, script write data, style write CSS

<template>
  <div id="app">
    {{n}}
    <button @click="add">+1</button>
  </div>
</template>

<script>
export default {
 data(){
   return{
     n:0
   }
 },
  methods:{
   add(){
     this.n += 1
   }
  }
}
</script>

<style lang="scss">
#app {
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;
}
</style>

Copy the code

Main.js

import Vue from 'vue'
import App from './App.vue'

Vue.config.productionTip = false

new Vue({
  render: h= > h(App),
}).$mount('#app')

Copy the code

Seo friendly

Curl curl curl curl curl curl curl curl curl curl curl curl

Curl: title, description, keyword, h1, a