vuejs / vue-cli

🛠️ webpack-based tooling for Vue.js Development
https://cli.vuejs.org/
MIT License
29.76k stars 6.33k forks source link

vue-cli3 集成electron-vue svg 出不来 #4678

Closed snail-boy closed 5 years ago

snail-boy commented 5 years ago

> ```js

return require('../img/girl.jpg')



The require will be handled by file-loader and return the after-build file location.

尤大, vue-cli3项目集成electron-vue 桌面系统, svg 怎么显示不出来,

import Vue from 'vue'
import SvgIcon from '@/components/SvgIcon'// svg component

// register globally
Vue.component('svg-icon', SvgIcon)

const req = require.context('./svg', false, /\.svg$/)
// const requireAll = requireContext => requireContext.keys().map(requireContext)

const requireAll = requireContext => requireContext.keys().map((key) => {
  console.log(key, req(key))
})
requireAll(req)

j转成了base64位图片 image

正常的情况是 image

Originally posted by @websmallrabbit in https://github.com/vuejs/vue-cli/issues/47#issuecomment-541376328

vue-bot commented 5 years ago

Hello, thank you for taking time filling this issue!

However, we kindly ask you to use our Issue Helper when creating new issues, in order to ensure every issue provides the necessary information for us to investigate. This explains why your issue has been automatically closed by me (your robot friend!).

I hope to see your helper-created issue very soon!


你好,你的 issue 不符合我们所要求的格式,因此已被自动关闭。为了确保每个 issue 都提供必需的相关信息,请务必使用我们的 Issue 向导 来创建新 issue,谢谢!