White VUE Lesson learned: setting up the environment VUE Node.js VSCode template template

Environment to build VUE Node.js VSCode template template:

  1. First install the Node: http://www.runoob.com/nodejs/nodejs-install-setup.html
  2. Into the command line: win + r ----> cmd
  3. cd f: \
  4. md vuetest
  5. cd vuetest
  6. Installation webpack: npm install webpack -g
  7. Installation vue Scaffolding: npm install vue-cli -g
  8. Create a project: vue init webpack proj
    • Use ESLint to lint your code: This is the code warning this is very annoying would be best not
      1.  Project directory:
  9. Installation project dependencies: npm install
  10. Installation vue routing module vue-router and network requests module vue-resource: cnpm install vue-router vue-resource --save
  11. Installation elementui: npm install elementui --save
  12. The mounting vue gridster: npm install vue-power-drag
  13. Installation echarts: npm install echarts -S
  14. Installation axios awakened HTTP request:npm install axios
  15. VSCode follows:
    1. Meanwhile ctrl_s save the file to start compiling, after compiling complete input browser to http: // localhost: 8080 to see results
    2. VScode console can also be used npm start compiling ,, after compilation browser to http: // localhost: 8080 to see results

app.vue:

<template>
  <div id="app">
    <h2>Hello Zhai</h2>    
    <router-view/>
  </div>
</template>

<script>
export default {
  name: 'App'
}
</script>

<style>
#app {
  font-family: 'Future', Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;
}
</style>
 
index.js:
Import view from 'View'
import Router from 'vue-router'
import HelloWorld from '@/components/HelloWorld'
import Test from '@/components/Test'
import T123 from '@/components/T123'
import T456 from '@/components/T456'
import T789 from '@/components/T789'
import Slots from '@/components/Slots'


Vue.use(Router)
/* eslint-disable */
export default new Router({
  routes: [
    {
      path: '/',
      name: 'HelloWorld',
      component: HelloWorld
    },
    {
      path: '/test',
      name: 'Test',
      component: Test
    },
    {
      path: '/T123',
      name: 'T123',
      component: T123
    },
    {
      path: '/T456',
      name: 'T456',
      component: T456
    },
    {
      path: '/T789',
      name: 'T789',
      component: T789
    },
    {
      path: '/Slots',
      name: 'Slots',
      component: Slots
    }

  ]
})
 
main.js:
// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
Import view from 'View'
import App from './App'
import router from './router'
import Antd from 'ant-design-vue'
amount elk-design-vue / dist / antd.css'
Vue.config.productionTip = false

Vue.use(Antd)

/* eslint-disable no-new */
new view ({
  the '#app'
  router,
  components: { App },
  template: '<App/>'
})
index.html:
<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1.0">
    <title>myvue</title>
  </head>
  <body>
    <div id="app"></div>
    <!-- built files will be auto injected -->
  </body>
</html>

 

 

 

Guess you like

Origin www.cnblogs.com/li9club/p/11522423.html