mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-05-22 22:49:15 +08:00
breaking change: disable allow-html by default
This commit is contained in:
parent
c68e77abca
commit
02c7a75ee3
@ -174,6 +174,7 @@ Vue 3.0 中增加了 `Teleport` 组件,提供将组件渲染到任意 DOM 位
|
||||
|
||||
#### Dialog
|
||||
|
||||
- 默认关闭 `allow-html` 属性
|
||||
- `before-close` 属性用法调整,不再传入 done 函数,而是通过返回 Promise 来控制
|
||||
|
||||
#### ImagePreview
|
||||
@ -183,6 +184,7 @@ Vue 3.0 中增加了 `Teleport` 组件,提供将组件渲染到任意 DOM 位
|
||||
#### Picker
|
||||
|
||||
- `change` 事件参数不再传入组件实例
|
||||
- 默认关闭 `allow-html` 属性
|
||||
- 默认开启 `show-toolbar` 属性
|
||||
- 级联选择下,`confirm`、`change` 事件返回的回调参数将包含为完整的选项对象。
|
||||
|
||||
|
@ -27,6 +27,7 @@ export default createComponent({
|
||||
width: [Number, String],
|
||||
message: String,
|
||||
callback: Function,
|
||||
allowHtml: Boolean,
|
||||
className: null,
|
||||
beforeClose: Function,
|
||||
messageAlign: String,
|
||||
@ -36,10 +37,6 @@ export default createComponent({
|
||||
confirmButtonText: String,
|
||||
confirmButtonColor: String,
|
||||
closeOnClickOverlay: Boolean,
|
||||
allowHtml: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
transition: {
|
||||
type: String,
|
||||
default: 'van-dialog-bounce',
|
||||
|
@ -155,7 +155,7 @@ export default {
|
||||
| closeOnPopstate | Whether to close when popstate | _boolean_ | `true` |
|
||||
| closeOnClickOverlay | Whether to close when click overlay | _boolean_ | `false` |
|
||||
| lockScroll | Whether to lock body scroll | _boolean_ | `true` |
|
||||
| allowHtml `v2.8.7` | Whether to allow HTML rendering in message | _boolean_ | `true` |
|
||||
| allowHtml `v2.8.7` | Whether to allow HTML rendering in message | _boolean_ | `false` |
|
||||
| beforeClose | Callback function before close,<br>call done() to close dialog,<br>call done(false) to cancel loading | (action: string, done: Function) => void | - |
|
||||
| transition | Transition, equivalent to `name` prop of [transtion](https://vuejs.org/v2/api/#transition) | _string_ | - |
|
||||
| teleport | Return the mount node for Dialog | _string \| Element_ | `body` |
|
||||
@ -183,7 +183,7 @@ export default {
|
||||
| close-on-click-overlay | Whether to close when click overlay | _boolean_ | `false` |
|
||||
| lazy-render | Whether to lazy render util appeared | _boolean_ | `true` |
|
||||
| lock-scroll | Whether to lock background scroll | _boolean_ | `true` |
|
||||
| allow-html `v2.8.7` | Whether to allow HTML rendering in message | _boolean_ | `true` |
|
||||
| allow-html `v2.8.7` | Whether to allow HTML rendering in message | _boolean_ | `false` |
|
||||
| before-close | Callback function before close | _(action) => boolean \| Promise_ | - |
|
||||
| transition | Transition, equivalent to `name` prop of [transtion](https://vuejs.org/v2/api/#transition) | _string_ | - |
|
||||
| teleport | Return the mount node for Dialog | _string \| Element_ | - |
|
||||
|
@ -190,7 +190,7 @@ export default {
|
||||
| closeOnPopstate | 是否在页面回退时自动关闭 | _boolean_ | `true` |
|
||||
| closeOnClickOverlay | 是否在点击遮罩层后关闭弹窗 | _boolean_ | `false` |
|
||||
| lockScroll | 是否锁定背景滚动 | _boolean_ | `true` |
|
||||
| allowHtml `v2.8.7` | 是否允许 message 内容中渲染 HTML | _boolean_ | `true` |
|
||||
| allowHtml `v2.8.7` | 是否允许 message 内容中渲染 HTML | _boolean_ | `false` |
|
||||
| beforeClose | 关闭前的回调函数,<br>调用 done() 后关闭弹窗,<br>调用 done(false) 阻止弹窗关闭 | _(action, done) => void_ | - |
|
||||
| transition | 动画类名,等价于 [transtion](https://cn.vuejs.org/v2/api/index.html#transition) 的`name`属性 | _string_ | - |
|
||||
| teleport | 指定挂载的节点,[用法示例](#/zh-CN/popup#zhi-ding-gua-zai-wei-zhi) | _string \| Element_ | `body` |
|
||||
@ -220,7 +220,7 @@ export default {
|
||||
| close-on-click-overlay | 是否在点击遮罩层后关闭弹窗 | _boolean_ | `false` |
|
||||
| lazy-render | 是否在显示弹层时才渲染节点 | _boolean_ | `true` |
|
||||
| lock-scroll | 是否锁定背景滚动 | _boolean_ | `true` |
|
||||
| allow-html `v2.8.7` | 是否允许 message 内容中渲染 HTML | _boolean_ | `true` |
|
||||
| allow-html `v2.8.7` | 是否允许 message 内容中渲染 HTML | _boolean_ | `false` |
|
||||
| before-close | 关闭前的回调函数,返回 `false` 可阻止关闭,支持返回 Promise | _(action) => boolean \| Promise_ | - |
|
||||
| transition | 动画类名,等价于 [transtion](https://cn.vuejs.org/v2/api/index.html#transition) 的`name`属性 | _string_ | - |
|
||||
| teleport | 指定挂载的节点,[用法示例](#/zh-CN/popup#zhi-ding-gua-zai-wei-zhi) | _string \| Element_ | - |
|
||||
|
@ -45,7 +45,7 @@ Dialog.defaultOptions = {
|
||||
callback: null,
|
||||
teleport: 'body',
|
||||
className: '',
|
||||
allowHtml: true,
|
||||
allowHtml: false,
|
||||
lockScroll: true,
|
||||
transition: 'van-dialog-bounce',
|
||||
beforeClose: null,
|
||||
|
@ -249,7 +249,7 @@ export default {
|
||||
| toolbar-position | Toolbar position, cat be set to `bottom` | _string_ | `top` |
|
||||
| loading | Whether to show loading prompt | _boolean_ | `false` |
|
||||
| show-toolbar | Whether to show toolbar | _boolean_ | `true` |
|
||||
| allow-html | Whether to allow HTML in option text | _boolean_ | `true` |
|
||||
| allow-html | Whether to allow HTML in option text | _boolean_ | `false` |
|
||||
| default-index | Default value index of single column picker | _number \| string_ | `0` |
|
||||
| item-height `v2.8.6` | Option height, supports `px` `vw` `rem` unit, default `px` | _number \| string_ | `44` |
|
||||
| visible-item-count | Count of visible columns | _number \| string_ | `6` |
|
||||
|
@ -272,7 +272,7 @@ export default {
|
||||
| toolbar-position | 顶部栏位置,可选值为`bottom` | _string_ | `top` |
|
||||
| loading | 是否显示加载状态 | _boolean_ | `false` |
|
||||
| show-toolbar | 是否显示顶部栏 | _boolean_ | `true` |
|
||||
| allow-html | 是否允许选项内容中渲染 HTML | _boolean_ | `true` |
|
||||
| allow-html | 是否允许选项内容中渲染 HTML | _boolean_ | `false` |
|
||||
| default-index | 单列选择时,默认选中项的索引 | _number \| string_ | `0` |
|
||||
| item-height `v2.8.6` | 选项高度,支持 `px` `vw` `rem` 单位,默认 `px` | _number \| string_ | `44` |
|
||||
| visible-item-count | 可见的选项个数 | _number \| string_ | `6` |
|
||||
|
@ -14,6 +14,7 @@ export const pickerProps = {
|
||||
title: String,
|
||||
loading: Boolean,
|
||||
readonly: Boolean,
|
||||
allowHtml: Boolean,
|
||||
itemHeight: [Number, String],
|
||||
cancelButtonText: String,
|
||||
confirmButtonText: String,
|
||||
@ -21,10 +22,6 @@ export const pickerProps = {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
allowHtml: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
visibleItemCount: {
|
||||
type: [Number, String],
|
||||
default: 6,
|
||||
|
Loading…
x
Reference in New Issue
Block a user