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

u-tabbar-item中文乱码 #1125

Open
HuckOps opened this issue Mar 12, 2025 · 0 comments
Open

u-tabbar-item中文乱码 #1125

HuckOps opened this issue Mar 12, 2025 · 0 comments

Comments

@HuckOps
Copy link

HuckOps commented Mar 12, 2025

自定义tabbar,代码如下

<template>
  <view>
    <u-tabbar @change="changeTab" :value="tabIndex" :fixed="true" :placeholder="true" :safeAreaInsetBottom="true">
      <u-tabbar-item :text="item.text" :name="item.name" icon="home" v-for="item in tabList" v-bind:key="item.name" @click="tabClick(item.path)">
      </u-tabbar-item>
    </u-tabbar>
  </view>
</template>
<script>
export default {
  name: 'tabbar',
  props: {
    tabIndex: {
       type: Number,
       default: 0
    }
  },
  data() {
    return {
       tabList: [
        {
          text: "换班",
          name: 0,
          icon: 'home',
          path: '/pages/index/index'
        },
        {
          text: '个人中心',
          name: 1,
          icon: 'account',
          path: '/pages/my/my'
        }
      ]
    };
  },
  methods: {
     tabClick(path) {
		 console.log(path);
         uni.switchTab({
            url: path
         });
      }
    }
  };
</script>

编译后发现u-tabbar-item乱码,页面中其他内容都正常,仅有这里乱码

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant