question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Use element-ui in electron-vue template have strange problems

See original GitHub issue

Found an issue or bug with electron-vue? Tell me all about it!

My project use element-ui have strange problems when i update laster electron-vue template. I don’t known why in dev mode have not run, but i found web mode can running good.

Describe the issue / bug.

use element-ui component in LandingPage.vue

        <el-tooltip class="item" effect="dark" content="Top Left 提示文字" placement="top-start">
          <el-button>you can click this is not work</el-button>
        </el-tooltip>

command: npm run dev result not have show tooltip

command: npm run build:web will good performance

How can I reproduce this problem?

npm install element-ui

in main.js

import Vue from 'vue'
import axios from 'axios'

import App from './App'
import router from './router'
import store from './store'

import ElementUI from 'element-ui'
import 'element-ui/lib/theme-default/index.css'

Vue.use(ElementUI)

if (!process.env.IS_WEB) Vue.use(require('vue-electron'))
Vue.http = Vue.prototype.$http = axios
Vue.config.productionTip = false

/* eslint-disable no-new */
new Vue({
  template: '<App/>',
  components: { App },
  router,
  store
}).$mount('#app')

in renderer/components/LandingPage.vue

<template>
  <div id="wrapper">
    <img id="logo" src="~@/assets/logo.png" alt="electron-vue">
    <main>
      <div class="left-side">
        <span class="title">
          Welcome to your new project!
        </span>
        <system-information></system-information>
      </div>

      <div class="right-side">
        <div class="doc">
          <div class="title">Getting Started</div>
          <p>
            electron-vue comes packed with detailed documentation that covers everything from
            internal configurations, using the project structure, building your application,
            and so much more.
          </p>
          <button @click="open('https://simulatedgreg.gitbooks.io/electron-vue/content/')">Read the Docs</button><br><br>
        </div>
        <div>
        <el-tooltip class="item" effect="dark" content="Top Left 提示文字" placement="top-start">
          <el-button>you can click this is not work</el-button>
        </el-tooltip>
        </div>
        <div class="doc">
          <div class="title alt">Other Documentation</div>
          <button class="alt" @click="open('https://electron.atom.io/docs/')">Electron</button>
          <button class="alt" @click="open('https://vuejs.org/v2/guide/')">Vue.js</button>
        </div>
      </div>
    </main>
  </div>
</template>

Two Result: command: npm run dev command: npm run build:web

you can test it.

Tell me about your development environment.
  • Node version: 7.9.0
  • NPM version: 5.3.0
  • vue-cli version: (if necessary)
  • Operating System: darwin

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:16 (4 by maintainers)

github_iconTop GitHub Comments

81reactions
SimulatedGREGcommented, Aug 31, 2017

@imRainChen

Okay, I am able to reproduce this issue now. It seems element-ui falls into that category of modules that need to be white-listed. If you go into .electron-vue/webpack.renderer.config.js, around line 21, you can add element-ui to the whiteListedModules list. After making that change, tooltips will work as expected.

0reactions
todoyelcommented, Dec 22, 2019

@SimulatedGREG I am facing the same problem. The template UI is working on the web perfectly but when I try to integrate with electron it’s breaking the UI. I have added two images.

image image

Read more comments on GitHub >

github_iconTop Results From Across the Web

vue.js - Vuejs Error: Unknown custom element did you register ...
The strange thing is, that I only get this error, when I reload the page. When I change the name of a function...
Read more >
electron-vue 中element-ui的el-table列表不显示、样式不起作用等 ...
参考地址Use element-ui in electron-vue template have strange problems 我们需要把element-ui加入到.electron-vue/webpack.renderer.config.js文件中的白名单里面 ...
Read more >
Native desktop applications using Vue.js - codeburst
Another problem is that applications based on Electron or NW.js don't look like native desktop applications. Their user interface is basically HTML and...
Read more >
A curated list of awesome things related to Vue.js - Gitee
NET Core Vue Starter CLI 3.0 A Vue starter template using Vue CLI 3.0 ... Firebase (Firestore/Auth/Storage), Element-UI, Disqus, Vuex, Vue-Router, and Sass....
Read more >
CSS psuedo element not showing svg background image-Vue.js
Timed out retrying: cy.type() failed because this element is not visible. has CSS property: position: fixed and it's being covered by another element:...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found