1.0.4 • Published 2 years ago

bluestar-areaselection v1.0.4

Weekly downloads
-
License
-
Repository
-
Last release
2 years ago

bluestar-AreaSelection

市县乡三级区划选择

引入

在script标签中引入组件

//使用HBuilderX导入插件
import AreaSelection from "@/uni_modules/bluestar-AreaSelection/components/bluestar-AreaSelection/bluestar-AreaSelection.vue"

//使用npm install
import AreaSelection from "bluestar-areaselection/components/bluestar-AreaSelection/bluestar-AreaSelection.vue"

代码演示

<template>
	<AreaSelection :show="show" :topArea="topArea" @close="close" @sure="sure"></AreaSelection>
</template>

<script setup lang="ts">
import {reactive, ref} from "vue"

const show = ref(false)

const topArea : any = reactive({
	areaName : '仙桃市',
	areaCode : '429004',
})

const close = () => {
	show.value = false
}

const sure = (obj : object) => {
	console.log('areaCode:' + obj)
}
</script>

API

Props

参数说明类型默认值/参考值
show是否显示弹出层booleanfalse
topArea顶级地市区域名称/编码object{"areaName":"仙桃市","areaCode":"429004"}

Events

事件名称说明回调参数
bing:close点击取消按钮时触发-
bind:sure点击确定按钮时触发选中值

作者

npm.io