Commit 19ac3f47 by mamingqun

添加vconsole

parent 81a60df0
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
"eslint-plugin-vue": "^5.0.0", "eslint-plugin-vue": "^5.0.0",
"less": "^3.0.4", "less": "^3.0.4",
"less-loader": "^5.0.0", "less-loader": "^5.0.0",
"vconsole": "^3.3.4",
"vue-template-compiler": "^2.6.10" "vue-template-compiler": "^2.6.10"
}, },
"eslintConfig": { "eslintConfig": {
......
<template> <template>
<div id="app"> <div id="app">
<div id="nav"> <div id="nav">
<router-link to="/">Home</router-link> | <router-link to="/">Home</router-link>|
<router-link to="/about">About</router-link>| <router-link to="/about">About</router-link>|
<router-link to="/index">index</router-link>| <router-link to="/index">index</router-link>|
<router-link to="/loading">loading</router-link>| <router-link to="/loading">loading</router-link>|
<router-link to="/user">user</router-link> <router-link to="/user">user</router-link>
</div> </div>
<router-view/> <router-view />
</div> </div>
</template> </template>
<style lang="less"> <style lang="less">
#app { #app {
font-family: 'Avenir', Helvetica, Arial, sans-serif; font-family: "Avenir", Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased; -webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale; -moz-osx-font-smoothing: grayscale;
text-align: center; text-align: center;
......
...@@ -5,6 +5,17 @@ import store from './store' ...@@ -5,6 +5,17 @@ import store from './store'
Vue.config.productionTip = false Vue.config.productionTip = false
/*
*公共库引用
*/
import vconsole from 'vconsole';
// 打测试包添加vconsole
if (process.env.VUE_APP_BUILD_TYPE && process.env.VUE_APP_BUILD_TYPE === 'test') {
new vconsole()
}
new Vue({ new Vue({
router, router,
store, store,
......
...@@ -2,7 +2,8 @@ ...@@ -2,7 +2,8 @@
<div class="home"> <div class="home">
<img alt="Vue logo" src="../assets/logo.png" /> <img alt="Vue logo" src="../assets/logo.png" />
<!-- <HelloWorld msg="Welcome to Your Vue.js App"/> --> <!-- <HelloWorld msg="Welcome to Your Vue.js App"/> -->
<h1>22{{msg}}</h1> <h1>home页{{msg}}</h1>
<button @click="testJump">跳转详情</button>
</div> </div>
</template> </template>
...@@ -20,9 +21,14 @@ export default { ...@@ -20,9 +21,14 @@ export default {
mounted() { mounted() {
this.msg = process.env.NODE_ENV this.msg = process.env.NODE_ENV
console.log( process.env.NODE_ENV ) console.log(process.env.NODE_ENV)
}, },
methods: {
testJump() {
this.$router.push({ path: 'detail', query: { detailId: 123456 } })
}
},
components: { components: {
HelloWorld HelloWorld
} }
......
...@@ -7953,6 +7953,11 @@ vary@~1.1.2: ...@@ -7953,6 +7953,11 @@ vary@~1.1.2:
resolved "https://registry.npm.taobao.org/vary/download/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc" resolved "https://registry.npm.taobao.org/vary/download/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc"
integrity sha1-IpnwLG3tMNSllhsLn3RSShj2NPw= integrity sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=
vconsole@^3.3.4:
version "3.3.4"
resolved "https://registry.npm.taobao.org/vconsole/download/vconsole-3.3.4.tgz#a7dacd8887b3d3e902e8d18425cda56c34e77f51"
integrity sha1-p9rNiIez0+kC6NGEJc2lbDTnf1E=
vendors@^1.0.0: vendors@^1.0.0:
version "1.0.3" version "1.0.3"
resolved "https://registry.npm.taobao.org/vendors/download/vendors-1.0.3.tgz#a6467781abd366217c050f8202e7e50cc9eef8c0" resolved "https://registry.npm.taobao.org/vendors/download/vendors-1.0.3.tgz#a6467781abd366217c050f8202e7e50cc9eef8c0"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment