element
element copied to clipboard
[Feature Request] Can I set default selected value for Cascader?
Existing Component
Yes
Component Name
Cascader
Description
Can I set default selected value for Cascader?
Please read the official documentation carefully。You can use v-model to bind default value.
Please read the official documentation carefully。You can use v-model to bind default value.
I mean can I set one value 'selected' in the Cascader so I don't need to select it every time.
Yeah,that is what i mean. You don`t setlect any value in the Cascader. v-model='option' The type of this 'option' is a list , you can set some values in it, and then display them in the Cascader as a default value.
------------------ 原始邮件 ------------------ 发件人: @.>; 发送时间: 2021年12月21日(星期二) 下午4:30 收件人: @.>; 抄送: @.>; @.>; 主题: Re: [ElemeFE/element] [Feature Request] Can I set default selected value for Cascader? (Issue #21557)
Please read the official documentation carefully。You can use v-model to bind default value.
I mean can I set one value 'selected' in the Cascader so I don't need to select it every time.
— Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you commented.Message ID: @.***>
There is a mistake, it can be any type. v-model='option' The value of the 'option' must be included in the cascader-list.
------------------ 原始邮件 ------------------ 发件人: "ElemeFE/element" @.>; 发送时间: 2021年12月21日(星期二) 下午4:30 @.>; @.@.>; 主题: Re: [ElemeFE/element] [Feature Request] Can I set default selected value for Cascader? (Issue #21557)
Please read the official documentation carefully。You can use v-model to bind default value.
I mean can I set one value 'selected' in the Cascader so I don't need to select it every time.
— Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you commented.Message ID: @.***>


emm..just like what I said. v-model='value' . The value is a list. The structure of the value needs to correspond to the tree structure of the 'option' list.
my code..
I tried it out using an example from Element's website, it worked! You dont`t need to search 'value' of options and click to make it selected.
------------------ 原始邮件 ------------------ 发件人: @.>; 发送时间: 2021年12月21日(星期二) 晚上10:35 收件人: @.>; 抄送: @.>; @.>; 主题: Re: [ElemeFE/element] [Feature Request] Can I set default selected value for Cascader? (Issue #21557)
I mean, how can I set one of the values in the 'option' list selected? Like shown in the screenshot, I need to search 'fiscal_year_week' and click to make it selected, how should it set to be selected by default that I don't need to click it manually. If we are using normal html, just use 'fiscal_year_week ', but how should we do it in Cascader? — Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you commented.Message ID: @.***>
emm..just like what I said. v-model='value' . The value is a list. The structure of the value needs to correspond to the tree structure of the 'option' list. my code.. <div class="block"> <span class="demonstration">Factor1: </span> <el-cascader v-model="value" clearable :options="options" @change="handleChange" /> </div> value: ['a'], // value: ['b', 'b1'], // value: ['c', 'c1', 'c11'], options: [ { value: 'a', label: 'A' }, { value: 'b', label: 'B', children: [ { value: 'b1', label: 'B-1' } ] }, { value: 'c', label: 'C', children: [ { value: 'c1', label: 'C-1', children: [ { value: 'c11', label: 'C-1-1' } ] } ] } ] I tried it out using an example from Element's website, it worked! You dont`t need to search 'value' of options and click to make it selected. … ------------------ 原始邮件 ------------------ 发件人: @.>; 发送时间: 2021年12月21日(星期二) 晚上10:35 收件人: @.>; 抄送: @.>; @.>; 主题: Re: [ElemeFE/element] [Feature Request] Can I set default selected value for Cascader? (Issue #21557) I mean, how can I set one of the values in the 'option' list selected? Like shown in the screenshot, I need to search 'fiscal_year_week' and click to make it selected, how should it set to be selected by default that I don't need to click it manually. If we are using normal html, just use 'fiscal_year_week ', but how should we do it in Cascader? — Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you commented.Message ID: @.***>
Got it, thank you so much
You are welcome! Nice to help you.By the way ,where are you come form?
------------------ 原始邮件 ------------------ 发件人: @.>; 发送时间: 2022年1月5日(星期三) 中午11:35 收件人: @.>; 抄送: @.>; @.>; 主题: Re: [ElemeFE/element] [Feature Request] Can I set default selected value for Cascader? (Issue #21557)
emm..just like what I said. v-model='value' . The value is a list. The structure of the value needs to correspond to the tree structure of the 'option' list. my code.. <div class="block"> <span class="demonstration">Factor1: </span> <el-cascader v-model="value" clearable :options="options" @change="handleChange" /> </div> value: ['a'], // value: ['b', 'b1'], // value: ['c', 'c1', 'c11'], options: [ { value: 'a', label: 'A' }, { value: 'b', label: 'B', children: [ { value: 'b1', label: 'B-1' } ] }, { value: 'c', label: 'C', children: [ { value: 'c1', label: 'C-1', children: [ { value: 'c11', label: 'C-1-1' } ] } ] } ] I tried it out using an example from Element's website, it worked! You dont`t need to search 'value' of options and click to make it selected. … ------------------ 原始邮件 ------------------ 发件人: @.>; 发送时间: 2021年12月21日(星期二) 晚上10:35 收件人: @.>; 抄送: @.>; @.>; 主题: Re: [ElemeFE/element] [Feature Request] Can I set default selected value for Cascader? (Issue #21557) I mean, how can I set one of the values in the 'option' list selected? Like shown in the screenshot, I need to search 'fiscal_year_week' and click to make it selected, how should it set to be selected by default that I don't need to click it manually. If we are using normal html, just use 'fiscal_year_week ', but how should we do it in Cascader? — Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you commented.Message ID: @.***>
Got it, thank you so much
— Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you commented.Message ID: @.***>
You are welcome! Nice to help you.By the way ,where are you come form? … ------------------ 原始邮件 ------------------ 发件人: @.>; 发送时间: 2022年1月5日(星期三) 中午11:35 收件人: @.>; 抄送: @.>; @.>; 主题: Re: [ElemeFE/element] [Feature Request] Can I set default selected value for Cascader? (Issue #21557) emm..just like what I said. v-model='value' . The value is a list. The structure of the value needs to correspond to the tree structure of the 'option' list. my code.. <div class="block"> <span class="demonstration">Factor1: </span> <el-cascader v-model="value" clearable :options="options" @change="handleChange" /> </div> value: ['a'], // value: ['b', 'b1'], // value: ['c', 'c1', 'c11'], options: [ { value: 'a', label: 'A' }, { value: 'b', label: 'B', children: [ { value: 'b1', label: 'B-1' } ] }, { value: 'c', label: 'C', children: [ { value: 'c1', label: 'C-1', children: [ { value: 'c11', label: 'C-1-1' } ] } ] } ] I tried it out using an example from Element's website, it worked! You dont`t need to search 'value' of options and click to make it selected. … ------------------ 原始邮件 ------------------ 发件人: @.>; 发送时间: 2021年12月21日(星期二) 晚上10:35 收件人: @.>; 抄送: @.>; @.>; 主题: Re: [ElemeFE/element] [Feature Request] Can I set default selected value for Cascader? (Issue #21557) I mean, how can I set one of the values in the 'option' list selected? Like shown in the screenshot, I need to search 'fiscal_year_week' and click to make it selected, how should it set to be selected by default that I don't need to click it manually. If we are using normal html, just use 'fiscal_year_week ', but how should we do it in Cascader? — Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you commented.Message ID: @.> Got it, thank you so much — Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you commented.Message ID: @.>
I'm from China.
老铁,你早说啊。
------------------ 原始邮件 ------------------ 发件人: "ElemeFE/element" @.>; 发送时间: 2022年1月6日(星期四) 下午2:58 @.>; @.@.>; 主题: Re: [ElemeFE/element] [Feature Request] Can I set default selected value for Cascader? (Issue #21557)
You are welcome! Nice to help you.By the way ,where are you come form? … ------------------ 原始邮件 ------------------ 发件人: @.>; 发送时间: 2022年1月5日(星期三) 中午11:35 收件人: @.>; 抄送: @.>; @.>; 主题: Re: [ElemeFE/element] [Feature Request] Can I set default selected value for Cascader? (Issue #21557) emm..just like what I said. v-model='value' . The value is a list. The structure of the value needs to correspond to the tree structure of the 'option' list. my code.. <div class="block"> <span class="demonstration">Factor1: </span> <el-cascader v-model="value" clearable :options="options" @change="handleChange" /> </div> value: ['a'], // value: ['b', 'b1'], // value: ['c', 'c1', 'c11'], options: [ { value: 'a', label: 'A' }, { value: 'b', label: 'B', children: [ { value: 'b1', label: 'B-1' } ] }, { value: 'c', label: 'C', children: [ { value: 'c1', label: 'C-1', children: [ { value: 'c11', label: 'C-1-1' } ] } ] } ] I tried it out using an example from Element's website, it worked! You dont`t need to search 'value' of options and click to make it selected. … ------------------ 原始邮件 ------------------ 发件人: @.>; 发送时间: 2021年12月21日(星期二) 晚上10:35 收件人: @.>; 抄送: @.>; @.>; 主题: Re: [ElemeFE/element] [Feature Request] Can I set default selected value for Cascader? (Issue #21557) I mean, how can I set one of the values in the 'option' list selected? Like shown in the screenshot, I need to search 'fiscal_year_week' and click to make it selected, how should it set to be selected by default that I don't need to click it manually. If we are using normal html, just use 'fiscal_year_week ', but how should we do it in Cascader? — Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you commented.Message ID: @.> Got it, thank you so much — Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you commented.Message ID: @.>
I'm from China.
— Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you commented.Message ID: @.***>
老铁,你早说啊。 … ------------------ 原始邮件 ------------------ 发件人: "ElemeFE/element" @.>; 发送时间: 2022年1月6日(星期四) 下午2:58 @.>; @.@.>; 主题: Re: [ElemeFE/element] [Feature Request] Can I set default selected value for Cascader? (Issue #21557) You are welcome! Nice to help you.By the way ,where are you come form? … ------------------ 原始邮件 ------------------ 发件人: @.>; 发送时间: 2022年1月5日(星期三) 中午11:35 收件人: @.>; 抄送: @.>; @.>; 主题: Re: [ElemeFE/element] [Feature Request] Can I set default selected value for Cascader? (Issue #21557) emm..just like what I said. v-model='value' . The value is a list. The structure of the value needs to correspond to the tree structure of the 'option' list. my code.. <div class="block"> <span class="demonstration">Factor1: </span> <el-cascader v-model="value" clearable :options="options" @change="handleChange" /> </div> value: ['a'], // value: ['b', 'b1'], // value: ['c', 'c1', 'c11'], options: [ { value: 'a', label: 'A' }, { value: 'b', label: 'B', children: [ { value: 'b1', label: 'B-1' } ] }, { value: 'c', label: 'C', children: [ { value: 'c1', label: 'C-1', children: [ { value: 'c11', label: 'C-1-1' } ] } ] } ] I tried it out using an example from Element's website, it worked! You dont`t need to search 'value' of options and click to make it selected. … ------------------ 原始邮件 ------------------ 发件人: @.>; 发送时间: 2021年12月21日(星期二) 晚上10:35 收件人: @.>; 抄送: @.>; @.>; 主题: Re: [ElemeFE/element] [Feature Request] Can I set default selected value for Cascader? (Issue #21557) I mean, how can I set one of the values in the 'option' list selected? Like shown in the screenshot, I need to search 'fiscal_year_week' and click to make it selected, how should it set to be selected by default that I don't need to click it manually. If we are using normal html, just use 'fiscal_year_week ', but how should we do it in Cascader? — Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you commented.Message ID: @.> Got it, thank you so much — Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you commented.Message ID: @.> I'm from China. — Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you commented.Message ID: @.***>
哈哈。
笑死我了