mirror of
https://gitee.com/baidu/amis.git
synced 2024-11-29 18:48:45 +08:00
fix:copyAction复制问题 (#10254)
This commit is contained in:
parent
307fbf95aa
commit
5ea18679d0
@ -1443,10 +1443,10 @@ run action ajax
|
||||
|
||||
> `< 1.8.0 及以下版本`,以下属性与 args 同级。
|
||||
|
||||
| 属性名 | 类型 | 默认值 | 说明 |
|
||||
| ---------- | ------------------------------------ | ----------- | ---------------------------------- |
|
||||
| copyFormat | `string` | `text/html` | 复制格式 |
|
||||
| content | [模板](../../docs/concepts/template) | - | 指定复制的内容。可用 `${xxx}` 取值 |
|
||||
| 属性名 | 类型 | 默认值 | 说明 |
|
||||
| ---------- | ------------------------------------ | ------ | ---------------------------------- |
|
||||
| copyFormat | `string` | - | 复制格式 |
|
||||
| content | [模板](../../docs/concepts/template) | - | 指定复制的内容。可用 `${xxx}` 取值 |
|
||||
|
||||
### 打印
|
||||
|
||||
|
@ -34,7 +34,7 @@ export class CopyAction implements RendererAction {
|
||||
|
||||
if (action.args?.content) {
|
||||
event.context.env?.copy?.(action.args.content, {
|
||||
format: action.args?.copyFormat ?? 'text/html'
|
||||
format: action.args?.copyFormat
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -70,5 +70,5 @@ test('EventAction:copy', async () => {
|
||||
expect(copy.mock.calls[1][0]).toEqual(
|
||||
'the content is <a href="http://www.baidu.com">link</a> <b>bold</b>'
|
||||
);
|
||||
expect(copy.mock.calls[1][1]).toEqual({format: 'text/html'});
|
||||
expect(copy.mock.calls[1][1]).toEqual({format: undefined});
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user