uni-app
uni-app copied to clipboard
【bug】钉钉小程序在存在插槽后备内容的情况下,作用域插槽无效
版本信息
HbuilderX 4.15 uni-ui 1.5.0 vue 2
代码片段
demo.vue (页面)
<template>
<view>
<slot-test :list="list">
<template v-slot:default="{listItem}">
<view>{{ listItem.header }}</view>
<view>{{ listItem.body }}</view>
<view>{{ listItem.footer }}</view>
</template>
</slot-test>
</view>
</template>
<script>
export default {
data() {
return {
list: [
{header: '1', body: '1', footer: '1'},
{header: '2', body: '2', footer: '2'},
{header: '3', body: '3', footer: '3'},
{header: '4', body: '4', footer: '4'},
{header: '5', body: '5', footer: '5'},
{header: '6', body: '6', footer: '6'},
{header: '7', body: '7', footer: '7'},
{header: '8', body: '8', footer: '8'},
{header: '9', body: '9', footer: '9'},
{header: '0', body: '0', footer: '0'},
]
};
}
}
</script>
<style>
</style>
slotTest.vue (组件)
<template>
<view>
<template v-for="(item,index) in list">
<view :key="index">
<slot v-bind:listItem="item">
<!-- 后备内容 start -->
<view>
<view>
<text>
header
</text>
</view>
<view>
<text>
body
</text>
</view>
<view>
<text>
footer
</text>
</view>
</view>
<!-- 后备内容 end -->
</slot>
</view>
</template>
</view>
</template>
<script>
export default {
props: {
list: {
type: Array,
default: () => []
}
},
data() {
return {}
},
methods: {}
};
</script>
<style lang="scss" scoped>
</style>
复现步骤
图示:
如果把组件中 "后备内容 start" 至 "后备内容 end" 间元素注释掉,就会渲染出正常的数据了
@ximinez @HowardHinnant please review this PR at your convenience
@ckeshava can you update your branch and resolve the conflicts? @godexsoft adding you for an RPC sanity check.
@godexsoft We do have integration tests for type in ledger but all of them forwards to rippled as type is deprecated in Clio.
Also Clio do not return deprecated error if there's type in ledger request but returns default ledger response with a warning message. If rippled returns similar response there won't be any discrepancy.
Clio request:
{
"method": "ledger",
"params": [
{
"type": "ticket"
}
]
}
Response:
{
"result": {
"ledger_hash": "B93129538E2C211567FAC16702575CC278F288B9BEAB2FA8819E8142935256B4",
"ledger_index": 3007200,
"validated": True,
"ledger": {
"account_hash": "BD5DBDC8FAF4A66F8DD00FCC3311D6B7273690C58E219322E9E7482C25EA8AD1",
"close_flags": 0,
"close_time": 801266581,
"close_time_human": "2025-May-22 22:03:01.000000000 UTC",
"close_time_resolution": 10,
"close_time_iso": "2025-05-22T22:03:01Z",
"ledger_hash": "B93129538E2C211567FAC16702575CC278F288B9BEAB2FA8819E8142935256B4",
"parent_close_time": 801266580,
"parent_hash": "FE727AF6B6890F0D6BD62E95BB5786EE4BD6B90B641BC66B25A117C4E60F316D",
"total_coins": "99999926515219548",
"transaction_hash": "698B0C5B6CDB666D5B0FA2E480303AA8F53EC129D0D1963DA12EEB940D12CE6F",
"ledger_index": "3007200",
"closed": True
},
"status": "success"
},
"warnings": [
{
"id": 2004,
"message": "Some fields from your request are deprecated. Please check the documentation at https://xrpl.org/docs/references/http-websocket-apis/ and update your request. Field "type" is deprecated."
},
{
"id": 2001,
"message": "This is a clio server. clio only serves validated data. If you want to talk to rippled, include "ledger_index":"current" in your request"
},
{
"id": 2002,
"message": "This server may be out of date"
}
]
}
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 61.62%. Comparing base (
e718378) to head (8b472e1). Report is 309 commits behind head on develop.
Additional details and impacted files
@@ Coverage Diff @@
## develop #4934 +/- ##
===========================================
+ Coverage 61.58% 61.62% +0.04%
===========================================
Files 804 804
Lines 70640 70636 -4
Branches 36534 36522 -12
===========================================
+ Hits 43502 43528 +26
+ Misses 19836 19802 -34
- Partials 7302 7306 +4
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
- :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
Hi @ckeshava , it would be great if you could:
-
update this branch from the current
developand -
act on this feedback from @mounikakun
Also Clio do not return deprecated error if there's type in ledger request but returns default ledger response with a warning message. If rippled returns similar response there won't be any discrepancy.
Also , a warning is preferred over error for reasons of backwards compatibility with older rippled versions.
Hello, I'm working on rebasing my branch. This PR is quite old, so I'll need some time to wrangle out the old commits.
The type filter has been deprecated for many years now (as per the documentation on xrpl.org). Is there an official policy on when we can remove the deprecated features?
Furthermore, I do not agree with the current behavior of the Clio server. Since Clio ignores the type filter command, users might mis-interpret the response. I feel throwing an error is a better behavior.
However, I'm happy to make the necessary changes to provide a warning in this PR.