mirror of
https://github.com/tusen-ai/naive-ui.git
synced 2025-01-24 12:45:18 +08:00
487001d697
.demo.md for component demo .demo-entry.md for demo entry .md for common docs
46 lines
743 B
Markdown
46 lines
743 B
Markdown
# Disabled
|
|
Input can be disabled.
|
|
```html
|
|
<n-input
|
|
v-model="value"
|
|
type="input"
|
|
size="small"
|
|
placeholder="Oops! It is disabled."
|
|
:disabled="!active"
|
|
round
|
|
/>
|
|
<n-input
|
|
v-model="value"
|
|
type="textarea"
|
|
size="small"
|
|
placeholder="Oops! It is disabled."
|
|
:disabled="!active"
|
|
round
|
|
/>
|
|
<n-input pair separator="to" v-model="value" clearable :disabled="!active">
|
|
<template v-slot:affix>
|
|
<n-icon><cash-outline /></n-icon>
|
|
</template>
|
|
</n-input>
|
|
<n-switch v-model="active" />
|
|
```
|
|
```js
|
|
import cashOutline from 'naive-ui/lib/icons/cash-outline'
|
|
|
|
export default {
|
|
components: {
|
|
cashOutline
|
|
},
|
|
data() {
|
|
return {
|
|
active: false,
|
|
value: null
|
|
}
|
|
}
|
|
}
|
|
```
|
|
```css
|
|
.n-input {
|
|
margin-bottom: 8px;
|
|
}
|
|
``` |