In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly introduces the Ant Design packaging year how to select components of the relevant knowledge, the content is detailed and easy to understand, the operation is simple and fast, has a certain reference value, I believe that everyone after reading this Ant Design packaging year how to select components article will have a harvest, let's take a look.
Question one
When the DatePicker component is set to the year selection, the onChange event will not be triggered after clicking the year, the value cannot be obtained, and the panel will not be closed. Click the area outside the panel to close the panel, but the year is not selected. Only after selecting the year, hit the enter key to return correctly, so the design will be estimated by the user. Go directly to the code
Export default {methods: {onChange (date, dateString) {console.log (date, dateString);}
Page effect:
Solution method
After carefully reading the documents on the official website, we found the openChange event and panelChange event of the DatePicker component, so we have the following solution
Import moment from "moment"; export default {components: {moment}, data () {return {open: false, year: moment ()};}, methods: {openChange (status) {if (status) {this.open = true;} else {this.open = false;}}, panelChange (value) {this.year = value; this.open = false }}}
This solves the problem that the panel cannot be closed after clicking to select a copy of ten thousand years, but then I found a new problem, that is, the clear button does not take effect!
Then you can only override the emptying event or set the allowClear property to false, and the manual input date of the DatePicker component is not available, but I don't know why I want to do this thing, so it is recommended to hide the input box when developing.
After hiding:
This is the end of the article on "how to select components in the year of Ant Design packaging". Thank you for reading! I believe you all have a certain understanding of the knowledge of "how to choose components in the year of Ant Design packaging". If you want to learn more, you are welcome to follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.