Skip to content
This repository has been archived by the owner on Dec 12, 2017. It is now read-only.

node 6.10版本 ,支持吗? #154

Open
varrant opened this issue Mar 1, 2017 · 2 comments
Open

node 6.10版本 ,支持吗? #154

varrant opened this issue Mar 1, 2017 · 2 comments

Comments

@varrant
Copy link

varrant commented Mar 1, 2017

6.4正常,6.10,遇到以下问题
ERROR in ./src/index.js
Module not found: Error: Can't resolve './app' in '/mnt/subs/src'
@ ./src/index.js 13:11-27
@ multi webpack-dev-server/client?http://0.0.0.0:8888/ webpack/hot/dev-server webpack-hud ./src/index.js

//index.js 中的代码如下
import Vue from 'vue';
import VueRouter from 'vue-router';
import './styles/sass/common.scss';
import App from './app';
import configRouter from './router.js';

// footer
import publicFooter from './components/footer';

// 使用路由
Vue.use(VueRouter);

Vue.component('publicFooter', publicFooter);

/**
 * 路由相关 路由规则配置
 * */
const router = new VueRouter({
  mode: 'hash',
  base: __dirname,
  routes: configRouter
});

new Vue({
  // el: '#app',
  render: h => h(App),
  router
}).$mount('#app');
@TNT-Likely
Copy link

我也遇到了类似问题,可以运行,但是初始化不成功

@yipcma
Copy link

yipcma commented May 28, 2017

I face a similar problem when trying the get started in vue-router. the router-links show, but the router-view is not rendering anything.

<template>
  <div>
  <h1>Hello App!</h1>
  <p>
    <!-- use router-link component for navigation. -->
    <!-- specify the link by passing the `to` prop. -->
    <!-- <router-link> will be rendered as an `<a>` tag by default -->
    <router-link to="/foo">Go to Foo</router-link>
    <router-link to="/bar">Go to Bar</router-link>
  </p>
  <!-- route outlet -->
  <!-- component matched by the route will render here -->
  <router-view></router-view>
</div>
</template>

<script>
  export default {
    name: 'app'
  };
</script>
import Vue from 'vue';
import App from './app';

import VueRouter from 'vue-router';

Vue.use(VueRouter);

const Foo = { template: '<div>foo</div>' };
const Bar = { template: '<div>bar</div>' };

const routes = [
  { path: '/foo', component: Foo },
  { path: '/bar', component: Bar }
];

const router = new VueRouter({
  routes // short for routes: routes
});

new Vue({ // eslint-disable-line
  render: h => h(App),
  router
}).$mount('#app');

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants