mirror of
https://github.com/tusen-ai/naive-ui.git
synced 2024-12-27 05:00:48 +08:00
19 lines
239 B
Markdown
19 lines
239 B
Markdown
# 受控状态
|
|
```html
|
|
<n-checkbox :checked="value">复选框</n-checkbox>
|
|
<n-switch v-model="value"/>
|
|
```
|
|
```js
|
|
export default {
|
|
data() {
|
|
return {
|
|
value: false
|
|
}
|
|
}
|
|
}
|
|
```
|
|
```css
|
|
.n-checkbox {
|
|
margin: 0 12px 8px 0;
|
|
}
|
|
``` |