vue 构建根组件
Vue IP (Vue IP)
An ip address input with port and material design support.
具有端口和材料设计支持的IP地址输入。
安装 (Install)
$ yarn add vue-ip用法 (Usage)
import VueIp from 'VueIp';
new Vue({
components: {
VueIp
},
data() {
return {
ip: '127.0.0.1', // or null
port: '8888', // or null
};
},
methods: {
/**
* Will be called on changes to IP address or port
*/
change(ip, port, valid) {
console.log(ip, port, valid);
}
},
template: '<vue-ip :ip="ip" :port="port" :on-change="change" theme="material"></vue-ip>'
})支持 (Supports)
Pasting (with IP or with IP and port)
粘贴(使用IP或使用IP和端口)
IP Validation
IP验证
Optional material design theme
可选的材料设计主题
Optional Port
可选端口
No sub dependencies
没有子依赖性
道具 (Props)
| Prop | Type | Options |
|---|---|---|
| on-change | function | Will be called when changes |
| ip | string | null or ip address '127.0.0.1' |
| port | string | null or '8080' |
| placeholder | boolean | will show a dummy ip address within the placeholder |
| theme | string | 'material' (material design themed) |
| Struts | 类型 | 选件 |
|---|---|---|
| 不断变化 | 功能 | 更改时将被调用 |
| ip | 串 | null或ip地址'127.0.0.1' |
| 港口 | 串 | null或'8080' |
| 占位符 | 布尔值 | 将在占位符中显示一个虚拟IP地址 |
| 主题 | 串 | “材料”(以材料设计为主题) |
翻译自: https://vuejsexamples.com/a-ip-input-component-built-for-vue-2/
vue 构建根组件