2023-02-15 07:28:52 +00:00
< docs >
-- -
order : 7
title :
zh - CN : 可折叠触发区域
en - US : Collapsible
-- -
2023-04-28 06:08:21 +00:00
2023-02-15 07:28:52 +00:00
# # zh - CN
2023-04-28 06:08:21 +00:00
2023-02-15 07:28:52 +00:00
通过 ` collapsible ` 属性 , 可以设置面板的可折叠触发区域 。
2023-04-28 06:08:21 +00:00
2023-02-15 07:28:52 +00:00
# # en - US
2023-04-28 06:08:21 +00:00
2023-02-15 07:28:52 +00:00
Specify the trigger area of collapsible by ` collapsible ` .
2023-04-28 06:08:21 +00:00
2023-02-15 07:28:52 +00:00
< / docs >
< template >
< a -space direction = "vertical" >
2023-04-28 06:08:21 +00:00
< a -collapse v -model :activeKey ="activeKey" collapsible = "header" >
< a -collapse -panel key = "1" header = "This panel can only be collapsed by clicking text" >
2023-02-15 07:28:52 +00:00
< p > { { text } } < / p >
< / a - c o l l a p s e - p a n e l >
< / a - c o l l a p s e >
2023-04-28 06:08:21 +00:00
< a -collapse v -model :activeKey ="activeKey" collapsible = "icon" >
< a -collapse -panel key = "1" header = "This panel can only be collapsed by clicking icon" >
2023-02-15 07:28:52 +00:00
< p > { { text } } < / p >
< / a - c o l l a p s e - p a n e l >
< / a - c o l l a p s e >
< a -collapse collapsible = "disabled" >
2023-04-28 06:08:21 +00:00
< a -collapse -panel key = "1" header = "This panel can't be collapsed" >
2023-02-15 07:28:52 +00:00
< p > { { text } } < / p >
< / a - c o l l a p s e - p a n e l >
< / a - c o l l a p s e >
< / a - s p a c e >
< / template >
2023-04-28 06:08:21 +00:00
< script lang = "ts" setup >
import { ref } from 'vue' ;
const activeKey = ref ( [ '1' ] ) ;
const text = ` A dog is a type of domesticated animal. Known for its loyalty and faithfulness, it can be found as a welcome guest in many households across the world. ` ;
2023-02-15 07:28:52 +00:00
< / script >
2023-04-28 06:08:21 +00:00
< style scoped >
2023-02-15 07:28:52 +00:00
. ant - space {
width : 100 % ;
}
< / style >