vue-cli-3

Loading preload script in Electron and Vue

吃可爱长大的小学妹 提交于 2021-02-16 14:39:30
问题 I am using Vue CLI 3 and vue-cli-plugin-electron-builder to package my Vue Electron app and I am not able to get my preload.js script for electron working. main window win = new BrowserWindow({ width: 800, height: 600 webPreferences: { nodeIntegration: false, preload: path.join(__dirname, "/../src/preload.js") // works but window.electron.dialog in undefined } }); preload.js const { dialog } = require("electron"); window.electron = {}; window.electron.dialog = dialog; The window.electron

TypeError ERR_UNESCAPED_CHARACTERS on testing Vue project using Nightwatch

邮差的信 提交于 2021-01-29 14:18:07
问题 I have a problem trying to setup my Nightwatch environment with Vue CLI. At this point, I just want to make it work with Chrome (we'll see for Firefox soon) but when I run a simple test, It doesn't work. Here is my test file: module.exports = { 'default e2e tests': browser => { browser .url("http://localhost:8080") .waitForElementVisible('#app', 5000) .assert.ok(true) .end() } } throwing the folowing error: Error while running .isElementDisplayed() protocol action: TypeError [ERR_UNESCAPED

Vue Cli 3 disabling code splitting - Can't get rid of the hash file

一世执手 提交于 2021-01-27 19:05:30
问题 I have a vue.config.js setup that works nicely and cancels the default code splitting. But It's still outputs a CSS file with a hash identical to the CSS file with the nice name. I can write a script to delete it, but I wonder if there is a way to set the file to not output the CSS file with the hash. vue.config.js: const webpack = require("webpack"); const MiniCssExtractPlugin = require("mini-css-extract-plugin"); module.exports = { outputDir: "../assets/", configureWebpack: { plugins: [ new

How do you eventBus a bus to communicate updates to a view in a Vue component?

给你一囗甜甜゛ 提交于 2020-12-26 09:11:39
问题 Listen for custom events for the bus in component b. However, after dispatching events in component a, it accesses component b. the listening function of component b is executed, but msg of data function is not updated Please don't say Vuex . The relevant code is based on Vue CLi3 Here code: Component A: <template> <div> Component A <button @click="sendMsg">pushB</button> </div> </template> <script> import bus from './bus' export default { methods: { sendMsg() { bus.$emit('send', 'hello

Vue.js project using Vue I18n has got the following error: “TypeError: i18n is undefined”

这一生的挚爱 提交于 2020-12-13 04:11:46
问题 I'm trying to add internationalization on my Vue.js project using Vue I18n. I'm using the documentation (i.e. http://kazupon.github.io/vue-i18n/guide/sfc.html#basic-usage), but I've got the following error message: [Vue warn]: Error in render: "TypeError: i18n is undefined" found in ---> <MainNavBar> at src/components/MainNavBar.vue <VApp> <App> at src/App.vue <Root> vue.runtime.esm.js:619 TypeError: "i18n is undefined" $t vue-i18n.esm.js:167 render MainNavBar.vue:33 VueJS 42 <anonymous> main

Vuejs image src dynamic load doesn't work

假装没事ソ 提交于 2020-11-28 02:05:15
问题 I just started using Vue.js and Vue CLI and i'm facing an issue, i don't understand why i can't set the image dynamically from the scope but i can do it writing it directly in the HTML, obj.img is a string with @/assets/logo.png value too. I have a timeout faking an ajax call, but the browser does not resolve properly the routes for the image. <div slot="media"> <img :src="obj.img"> <!-- http://localhost:8080/@/assets/logo.png --> <img src="@/assets/logo.png"> <!-- http://localhost:8080/img