Today, I asked for leave to get vaccinated. When I got home, my colleague sent me a problem saying that the elementUI checkbox was unclickable. I thought it was the data, so I tried it on my computer. Find assign to checkedCities; String, number. You can check either of them, but you can’t check the elementUI checkbox when you look online.
situation
Cause of occurrence
- CheckedCities Defaults to []
- The min value is greater than or equal to 2
Unselected renderings are displayed
Open the image in a new window to see the full effect.
Code for problem recurrence
When the following code is opened in a browser, the checkbox is not selected
<! DOCTYPEhtml>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="Width = device - width, initial - scale = 1.0">
<link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
<title>The test Element</title>
</head>
<body>
<div id="app">
<el-checkbox-group v-model="checkedCities" :min="2">
<el-checkbox label="1" name="type">food</el-checkbox>
<el-checkbox label="2" name="type">To push the activity</el-checkbox>
<el-checkbox label="3" name="type">Offline themed activities</el-checkbox>
</el-checkbox-group>
</div>
</body>
<! -- import Vue before Element -->
<script src="https://unpkg.com/vue/dist/vue.js"></script>
<! -- import JavaScript -->
<script src="https://unpkg.com/element-ui/lib/index.js"></script>
<! -- -->
<script>
new Vue({
el: '#app'.data: function () {
return {
checkedCities: [].}}})</script>
</html>
Copy the code