Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

生成的wxml中莫名其妙的多了很多空格,对某些样式效果产生影响 #8884

Closed
bug4j opened this issue Mar 12, 2021 · 1 comment · Fixed by #9204
Closed
Labels
enhancement New feature or request F-vue2 Framework - Vue 2 T-weapp Target - 编译到微信小程序 V-3 Version - 3.x
Milestone

Comments

@bug4j
Copy link

bug4j commented Mar 12, 2021

相关平台

微信小程序

小程序基础库: 2.15.0
使用框架: Vue 2

复现步骤

  1. 新建一个页面demo.vue,内容如下
<template>
  <view style="width:100%">
    <view class="item">
      <text>Taro</text>
    </view>
    <view class="item">
      <text>Vue</text>
    </view>
  </view>
</template>

<script>
export default {

}
</script>
<style>
  .item {
    display: inline-block;
    width: 40%;
    box-sizing: border-box;
    height: 8em;
    line-height: 8em;
    text-align: center;
    background-color: coral;
    color: #fff;
  }
</style>
  1. 打开此页面,正常情况下 两个 view.item 之间应该无缝拼接,但是实际上会隔开一点,应为生成的wxml中两个元素之间多了一个空格:
    demo
    导致实际效果如下:
    view

期望结果

减少生成不必要的空格

实际结果

生成了很多多余的空格,影响内联元素之间的距离

环境信息

👽 Taro v3.1.1
  Taro CLI 3.1.1 environment info:
    System:
      OS: Windows 10
    Binaries:
      Node: 14.16.0 - D:\Develop\node-v12.16.1-win-x64\node.EXE
      npm: 6.14.11 - D:\Develop\node-v12.16.1-win-x64\npm.CMD  
@chenchenpp
Copy link

vue3也有相同问题,taro3.5.8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request F-vue2 Framework - Vue 2 T-weapp Target - 编译到微信小程序 V-3 Version - 3.x
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants