小编FNG*_*NGR的帖子

OS X上的mongod HostnameCanonicalizationWorker错误

我刚刚通过自制软件安装了MOngoDB,并希望通过命令行mongod启动它.

当我这样做时,我会得到这样的信息:

2016-03-05T19:23:55.763+0100 I CONTROL  [initandlisten] MongoDB starting : pid=52426 port=27017 dbpath=/data/db 64-bit host=Matthias-MBP
2016-03-05T19:23:55.764+0100 I CONTROL  [initandlisten] db version v3.2.3
2016-03-05T19:23:55.764+0100 I CONTROL  [initandlisten] git version: b326ba837cf6f49d65c2f85e1b70f6f31ece7937
2016-03-05T19:23:55.764+0100 I CONTROL  [initandlisten] allocator: system
2016-03-05T19:23:55.764+0100 I CONTROL  [initandlisten] modules: none
2016-03-05T19:23:55.764+0100 I CONTROL  [initandlisten] build environment:
2016-03-05T19:23:55.764+0100 I CONTROL  [initandlisten]     distarch: x86_64
2016-03-05T19:23:55.764+0100 I CONTROL  [initandlisten]     target_arch: x86_64
2016-03-05T19:23:55.764+0100 I CONTROL  [initandlisten] options: {}
2016-03-05T19:23:55.765+0100 I -        [initandlisten] Detected data files in /data/db created by the 'wiredTiger' storage engine, so …
Run Code Online (Sandbox Code Playgroud)

mongodb

9
推荐指数
2
解决办法
9275
查看次数

如何在Vuex中调用动作内部的动作

我尝试使用Rails API构建一个非常小的Vue应用程序.所以目前我与Vue,Vue-Resource和Vuex合作.我将从数据库中获取所有用户,现在我尝试更新其中一个用户.所以每个事情都运行正常(补丁用户),但在运行updateUser操作后,我想再次运行fetchUsers操作来更新Vuex存储.

但是当fetchUsers在updateUser promise中运行时,我收到以下错误:

undefined:1 Uncaught (in promise) TypeError: Cannot read property 'dispatch' of undefined
Run Code Online (Sandbox Code Playgroud)

这就是我的vuex/actions.js所看到的:

export const fetchUsers = function ({ dispatch, state }) {
  this.$http.get('http://localhost:3000/api/v1/users').then((response) => {
    dispatch('SET_USERS', response.data)
  }, (response) => {
    dispatch('SET_USERS', [])
    console.log(response)
  })
}

export const updateUser = function ({ dispatch, state }, user) {
  this.$http.patch('http://localhost:3000/api/v1/users/' + user.id, {user: user}).then((response) => {
    fetchUsers()
  }, (response) => {
    console.log(response)
  })
}
Run Code Online (Sandbox Code Playgroud)

我现在fetchUsers动作以某种方式失去了上下文(?)但我不知道如何处理它!谢谢你的帮助!

javascript ruby-on-rails vue.js vuex

6
推荐指数
1
解决办法
6210
查看次数

在webpack文件加载器中获取错误的输出路径

我无法获取webpack(3.10)文件加载器路径来满足需要。.这是我的webpack.config.js的一部分

// ...

const images = {
  test: /\.(jpg|png|svg)$/,
  use: {
    loader: 'file-loader',
    options: {
      name: 'images/[path][name].[hash].[ext]',
    },
  },
}

//...

const config = {
  entry: {
    App: './public/assets/js/main.js',
  },
  output: {
    path: path.resolve(__dirname, 'public', 'assets', 'dist'),
    filename: 'main.js',
  },
  module: {
    rules: [javascript, styles, images],
  },
  plugins: [new ExtractTextPlugin('main.css'), uglify],
}

//...
Run Code Online (Sandbox Code Playgroud)

我希望将图像放入其中,/public/assets/dist/images/XXX.svg但它们已被装入/public/assets/dist/images/public/assets/images/XXX.svg

我真的不明白...谢谢您的所有帮助。

svg webpack webpack-file-loader

2
推荐指数
1
解决办法
1619
查看次数