mirror of
https://github.com/Tencent/tmagic-editor.git
synced 2025-04-06 03:57:56 +08:00
38 lines
713 B
Markdown
38 lines
713 B
Markdown
# 联动
|
|
|
|
## 显隐
|
|
|
|
<demo-block type="form" :config="[{
|
|
name: 'switch',
|
|
text: '显示text',
|
|
type: 'switch'
|
|
}, {
|
|
name: 'text2',
|
|
text: '配置2',
|
|
display: (state, { model }) => model.switch
|
|
}]"></demo-block>
|
|
|
|
## 输入关联
|
|
|
|
<demo-block type="form" :config="[{
|
|
name: 'firstName',
|
|
text: '名',
|
|
onChange: (state, v, { model }) => {
|
|
model.fullName = `${model.lastName}${model.firstName}`
|
|
},
|
|
defaultValue: '三'
|
|
}, {
|
|
name: 'lastName',
|
|
text: '姓',
|
|
onChange: (state, v, { model }) => {
|
|
model.fullName = `${model.lastName}${model.firstName}`
|
|
},
|
|
defaultValue: '张'
|
|
}, {
|
|
name: 'fullName',
|
|
text: '姓名',
|
|
type: 'display',
|
|
defaultValue: '张三'
|
|
}]"></demo-block>
|
|
|