Giter Club home page Giter Club logo

uni-plate-input's Introduction

uni-plate-input

适配uni-app的车牌号输入组件

提示

兼容 H5 微信小程序 , 其他平台未测试

演示

使用

  1. 引入插件的vue文件并绑定触发事件
<template>
	<view class="cu-form-group">
		<view class="title">车牌号</view>
		<input placeholder="请点此输入" disabled="true" @tap="plateShow=true" v-model.trim="plateNo" />
		<plate-input v-if="plateShow" :plate="plateNo" @export="setPlate" @close="plateShow=false" />
	</view>
</template>

<script>
	import plateInput from '@/components/uni-plate-input/uni-plate-input.vue'
	export default {
		components: {
			plateInput
		},
		data() {
			return {
				plateNo:'',
				plateShow:false
			}
		},
		methods: {
			setPlate(plate){
				if(plate.length >= 7) this.plateNo = plate
				this.plateShow = false
			}
		}
	}
</script>

参数

  1. plate 配置默认车牌号参数

事件

  1. export 设置车牌号
  2. close 关闭弹出窗

样式

默认使用Less样式,也可以在 uni-plate-input.vue文件中的style标签里将引入样式更换成css或其他

<style scoped lang="less">
@import './uni-plate-input'; //引入Less
// @import './uni-plate-input.css'; //引入css
</style>

uni-plate-input's People

Contributors

minisola avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.