1.0.3 • Published 6 years ago

hll-m-components v1.0.3

Weekly downloads
12
License
-
Repository
-
Last release
6 years ago

hll-m-components

货拉拉移动端公共组件库,适用于Vue2.x,可以按需引入

安装

npm install hll-m-components --save

使用

注册组件

// 引入 hll-m-components 主文件
import { cityList } from 'hll-m-components';

// 全局注册组件
Vue.component('city-list', cityList);

// 局部注册(此例子为单文件组件)
import { cityList } from 'hll-m-components';
export default {
  components: {
    cityList
  }
}

.vue 单文件组件中使用:

<city-list :city-list-raw="cityList"
            :current-city-id="currentCityId"
            @chooseCity="getChoosedCity"
            v-if="isShowCityList && cityList.length"></city-list>

参数及方法

选项类型是否必填描述
city-list-rawArray必填城市列表数据,货拉拉城市列表数据(数据结构为2018年使用的数据结构)
current-city-idNumber or String必填当前城市id
chooseCityFunction必填接受组件向外传递的选中城市的数据