mirror of
https://github.com/tusen-ai/naive-ui.git
synced 2025-01-12 12:25:16 +08:00
29 lines
470 B
Markdown
29 lines
470 B
Markdown
|
# 基础
|
||
|
```html
|
||
|
<n-auto-complete :options="options" v-model="value" placeholder="邮箱" />
|
||
|
```
|
||
|
```js
|
||
|
export default {
|
||
|
computed: {
|
||
|
options () {
|
||
|
return [
|
||
|
'@gmail.com',
|
||
|
'@163.com',
|
||
|
'@qq.com'
|
||
|
].map(suffix => {
|
||
|
const prefix = this.value.split('@')[0]
|
||
|
return {
|
||
|
label: prefix + suffix,
|
||
|
value: prefix + suffix,
|
||
|
}
|
||
|
})
|
||
|
}
|
||
|
},
|
||
|
data () {
|
||
|
return {
|
||
|
value: ''
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
```
|