代码之家  ›  专栏  ›  技术社区  ›  Brian Zelip

SVG`viewBox`已在生产版本中删除,但仍处于开发模式(使用Parcel bundler)

  •  0
  • Brian Zelip  · 技术社区  · 6 年前

    为什么包裹生产建立在这个基础上Vue.js版应用程序删除硬编码 viewBox 视箱 不会删除,svg将正确呈现。

    以下是在netlify上直播svg问题的产品版本: https://errands.netlify.com/ .

    production build missing each list item svg viewBox attribute

    下面是在dev模式下正确呈现的svg的屏幕截图(请参见每个杂货店商品名称左侧的灰色“edit”图标):

    local dev build with the svg viewBox attribute as exptected

    以下是svg作为Vue组件的源代码: https://github.com/brianzelip/groceries-vue/blob/master/src/components/Icons/IconEditSolid.vue

    下面是调用上述svg组件的父组件: https://github.com/brianzelip/groceries-vue/blob/master/src/components/GroceryForm/GroceryFormItemEditLink.vue

    为什么生产构建会删除 视箱 svg元素的属性?如何阻止这种行为?

    0 回复  |  直到 6 年前