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

[Bug 上报] MessageBox 会弹出两次 #398

Closed
Coding-Journey-Studio opened this issue Jul 1, 2024 · 16 comments
Closed

[Bug 上报] MessageBox 会弹出两次 #398

Coding-Journey-Studio opened this issue Jul 1, 2024 · 16 comments
Labels
need reproduce 需要补充复现demo

Comments

@Coding-Journey-Studio
Copy link

Wot Design Uni 版本号

1.2.28

平台

微信小程序

复现Demo地址

重现步骤

<template>
<wd-message-box />
</template>
<script setup>
import { useMessage } from 'wot-design-uni'
const {show:MessageShow} = useMessage()
onMounted(() => {
  showMessage({ msg: 'showMessage' })
})
</script>

期望的结果是什么?

只弹出一次

实际的结果是什么?

会弹出两次弹窗。。

环境信息

No response

其他补充信息

No response

@Moonofweisheng
Copy link
Owner

重现步骤代码中存在错误

const {show:MessageShow} = useMessage()
onMounted(() => {
  showMessage({ msg: 'showMessage' })
})

MessageShow和showMessage对不上

@Moonofweisheng
Copy link
Owner

Moonofweisheng commented Jul 1, 2024

修正后的重现步骤,无法复现标题中的问题

1719819012485.mp4

@Moonofweisheng Moonofweisheng added need reproduce 需要补充复现demo and removed 🐞bug: need confirm 待确认的bug labels Jul 1, 2024
@Moonofweisheng
Copy link
Owner

需要补充完整复现demo,否则issue将被关闭。

@Coding-Journey-Studio
Copy link
Author

重现步骤代码中存在错误

const {show:MessageShow} = useMessage()
onMounted(() => {
  showMessage({ msg: 'showMessage' })
})

MessageShow和showMessage对不上

应该是showMessage(),我给发个视频和代码截图吧。

@Moonofweisheng
Copy link
Owner

重现步骤代码中存在错误

const {show:MessageShow} = useMessage()
onMounted(() => {
  showMessage({ msg: 'showMessage' })
})

MessageShow和showMessage对不上

应该是showMessage(),我给发个视频和代码截图吧。

需要提供完整复现demo,包含可复现内容的完整项目。

@Coding-Journey-Studio
Copy link
Author

20240702_100335.mp4
<template>
  <wd-button @click="testEvent">测试</wd-button>
  <wd-message-box />
</template>

<script lang="ts" setup>
import { useMessage } from 'wot-design-uni'
const { show: showMessage } = useMessage()
const testEvent = () => {
  showMessage({ msg: '测试测试' })
}
</script>

@Moonofweisheng
Copy link
Owner

20240702_100335.mp4

<template>
  <wd-button @click="testEvent">测试</wd-button>
  <wd-message-box />
</template>

<script lang="ts" setup>
import { useMessage } from 'wot-design-uni'
const { show: showMessage } = useMessage()
const testEvent = () => {
  showMessage({ msg: '测试测试' })
}
</script>

不能提供完整复现demo的话,你拿这个仓库去测试吧:https://github.com/Moonofweisheng/wot-starter-retail,这个issue关闭了。

@Coding-Journey-Studio
Copy link
Author

????这么掩耳盗铃?视频给你拍了,就那么几行代码,你自己写的 你自己不清楚?
你爱排查不排查。。又不是我的库。

@Moonofweisheng
Copy link
Owner

????这么掩耳盗铃?视频给你拍了,就那么几行代码,你自己写的 你自己不清楚? 你爱排查不排查。。又不是我的库。

看不懂中文吗?我测试过了无法复现,你的上下文所导致的问题,所以需要你的完整复现demo,你就这么理直气壮?伸手党?

@Coding-Journey-Studio
Copy link
Author

上哪上下文? 你看不懂中文? template里就那么几行。 script 哪个没给你截全了?有给你隐藏什么吗?版本号没给你是怎么的?提交bug 哪个不是按照你的协定写的? 你的开源 所以你最大咯。你爱查不查。拿你仓库测试一样的结果。。什么狗脾气。

????这么掩耳盗铃?视频给你拍了,就那么几行代码,你自己写的 你自己不清楚? 你爱排查不排查。。又不是我的库。

看不懂中文吗?我测试过了无法复现,你的上下文所导致的问题,所以需要你的完整复现demo,你就这么理直气壮?伸手党?

@Moonofweisheng
Copy link
Owner

????这么掩耳盗铃?视频给你拍了,就那么几行代码,你自己写的 你自己不清楚? 你爱排查不排查。。又不是我的库。

上哪上下文? 你看不懂中文? template里就那么几行。 script 哪个没给你截全了?有给你隐藏什么吗?版本号没给你是怎么的?提交bug 哪个不是按照你的协定写的? 你的开源 所以你最大咯。你爱查不查。拿你仓库测试一样的结果。。什么狗脾气。

????这么掩耳盗铃?视频给你拍了,就那么几行代码,你自己写的 你自己不清楚? 你爱排查不排查。。又不是我的库。

看不懂中文吗?我测试过了无法复现,你的上下文所导致的问题,所以需要你的完整复现demo,你就这么理直气壮?伸手党?

1719887736422.mp4

你确认看了怎么提bug的吗,本不想骂你。
image

@PdxLook
Copy link
Contributor

PdxLook commented Jul 8, 2024

@Moonofweisheng

index.vue
<template>
<!-- 弹窗 -->
    <wd-message-box></wd-message-box>
<view @click="clearMsg"></view>
</template>
<script lang="ts" setup>
import { ref } from 'vue'
import { useMessage } from 'wot-design-uni'
import Tabbar from '@/components/tabbar.vue'

const message = useMessage()
/**
 * 清空消息
 */
function clearMsg() {
  message
    .confirm({
      msg: '确定将所有消息标记为已读?',
      title: '清空未读',
    })
    .then(() => {
      console.log('点击了确定按钮')
    })
    .catch(() => {
      console.log('点击了取消按钮')
    })
}
</script>
layouts/default.vue
<template>
  <wd-config-provider>
    <slot />
    <wd-toast />
    <wd-message-box />
  </wd-config-provider>
</template>

<script lang="ts" setup>
// import type { ConfigProviderThemeVars } from 'wot-design-uni'

// const themeVars: ConfigProviderThemeVars = {
//   // colorTheme: 'red',
//   // buttonPrimaryBgColor: '#07c160',
//   // buttonPrimaryColor: '#07c160',
// }
</script>

bug应该是这样导致的,页面上重复出现了, 切没有配置独立的 selector

@reworkUp
Copy link

也遇到了用的是uni-best . default.vue 引入得了 子页面没有引入,也是出现点击一次弹出多次:





<script lang="ts" setup> import type { ConfigProviderThemeVars } from 'wot-design-uni' const themeVars: ConfigProviderThemeVars = { colorTheme: '#FA5151', buttonPrimaryBgColor: '#FA5151', buttonPrimaryColor: '#FFFFFF', } </script>

@Moonofweisheng
Copy link
Owner

也遇到了用的是uni-best . default.vue 引入得了 子页面没有引入,也是出现点击一次弹出多次:

<script lang="ts" setup> import type { ConfigProviderThemeVars } from 'wot-design-uni' const themeVars: ConfigProviderThemeVars = { colorTheme: '#FA5151', buttonPrimaryBgColor: '#FA5151', buttonPrimaryColor: '#FFFFFF', } </script>

参考这个仓库,弄个复现demo看看: https://github.com/Moonofweisheng/wot-starter-retail

@oknixus
Copy link
Contributor

oknixus commented Jul 25, 2024

Wot Design Uni 版本号

1.2.28

平台

微信小程序

复现Demo地址

重现步骤

<template>
<wd-message-box />
</template>
<script setup>
import { useMessage } from 'wot-design-uni'
const {show:MessageShow} = useMessage()
onMounted(() => {
  showMessage({ msg: 'showMessage' })
})
</script>

期望的结果是什么?

只弹出一次

实际的结果是什么?

会弹出两次弹窗。。

环境信息

No response

其他补充信息

No response

把代码中的<wd-message-box />删掉,就不会重复出现了

Copy link

此 issue 已被自动锁定,因为关闭后没有任何近期活动。如果有相关 bug,请重新创建一个新 issue。

@github-actions github-actions bot locked and limited conversation to collaborators Aug 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
need reproduce 需要补充复现demo
Projects
None yet
Development

No branches or pull requests

5 participants