元素UI与电子

时间:2017-07-03 11:26:26

标签: vue.js electron

是否有人试图将它与Electron一起使用?我无法运行它。

而不是<el-button type="primary" @click.native="test">Primary Button</el-button>我只看到主要按钮文字。

可能是一些装载机......

以下是我的内容: webpack.config.js

var path = require('path')
var webpack = require('webpack')

module.exports = {
  entry: './app/main.js',
  output: {
    path: path.resolve(__dirname, './dist'),
    filename: 'build.js'
  },
  module: {
    loaders: [
    {
      test: /\.vue$/,
      loader: 'vue'
    },
    {
      test: /\.js$/,
      loader: 'babel',
      exclude: /node_modules/
    },
    {
      test: /\.css$/,
      loaders: ['style-loader', 'css-loader', 'postcss-loader']
    },
    {
      test: /\.(png|jpg|jpeg|gif|eot|ttf|woff|woff2|svg|svgz)(\?.+)?$/,
      loader: 'file'
    }]
  },
  babel: {
    "presets": ["es2015"],
    "plugins": ["transform-runtime"]
  },
  plugins: [
    new webpack.ExternalsPlugin('commonjs', [
      'electron'
    ])
  ]
}

Main.js 很简单:

import Vue from 'vue'
import { Button } from 'element-ui'
import 'element-ui/lib/theme-default/index.css'
import App from './App.vue'

Vue.use(Button)

new Vue({
  el: 'body',
  components: { App }
})

这是我的dev-dependencies列表:

  • &#34; autoprefixer&#34;:&#34; ^ 7.1.1&#34;
  • &#34; babel-core&#34;:&#34; ^ 6.7.4&#34;
  • &#34; babel-loader&#34;:&#34; ^ 6.2.4&#34;
  • &#34; babel-plugin-transform-runtime&#34;:&#34; ^ 6.6.0&#34;
  • &#34; babel-preset-es2015&#34;:&#34; ^ 6.6.0&#34;
  • &#34; babel-runtime&#34;:&#34; ^ 5.8.38&#34;
  • &#34; css-loader&#34;:&#34; ^ 0.23.1&#34;
  • &#34;电子预制&#34;:&#34; ^ 0.37.2&#34;
  • &#34; file-loader&#34;:&#34; ^ 0.11.2&#34;
  • &#34; postcss-loader&#34;:&#34; ^ 2.0.6&#34;
  • &#34; style-loader&#34;:&#34; ^ 0.18.2&#34;
  • &#34; url-loader&#34;:&#34; ^ 0.5.8&#34;
  • &#34; vue-hot-reload-api&#34;:&#34; ^ 1.3.2&#34;
  • &#34; vue-html-loader&#34;:&#34; ^ 1.2.0&#34;
  • &#34; vue-loader&#34;:&#34; ^ 8.2.2&#34;
  • &#34; vue-style-loader&#34;:&#34; ^ 1.0.0&#34;
  • &#34; webpack&#34;:&#34; ^ 1.12.14&#34;
  • &#34; webpack-dev-server&#34;:&#34; ^ 1.14.1&#34;

依赖项:

  • &#34; element-ui&#34;:&#34; ^ 1.3.7&#34;
  • &#34; jquery&#34;:&#34; ^ 2.2.2&#34;
  • &#34; vue&#34;:&#34; ^ 1.0.19&#34;

由于

0 个答案:

没有答案