selector-picker.js 3.5 KB

12345678910
  1. (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["components/w-picker/selector-picker"],{"08b8":function(t,e,n){"use strict";n.r(e);var i=n("8eef"),r=n("bee2");for(var u in r)["default"].indexOf(u)<0&&function(t){n.d(e,t,(function(){return r[t]}))}(u);n("1d4a");var a,o=n("8261"),l=Object(o["a"])(r["default"],i["b"],i["c"],!1,null,null,null,!1,i["a"],a);e["default"]=l.exports},"1d4a":function(t,e,n){"use strict";var i=n("b66b"),r=n.n(i);r.a},"753f":function(t,e,n){"use strict";function i(t){return o(t)||a(t)||u(t)||r()}function r(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function u(t,e){if(t){if("string"===typeof t)return l(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?l(t,e):void 0}}function a(t){if("undefined"!==typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function o(t){if(Array.isArray(t))return l(t)}function l(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var f={props:{itemHeight:{type:String,default:"44px"},options:{type:[Array,Object],default:function(){return[]}},value:{type:String,default:""},defaultType:{type:String,default:"label"},defaultProps:{type:Object,default:function(){return{label:"label",value:"value"}}}},data:function(){return{pickVal:[]}},computed:{nodeKey:function(){return this.defaultProps.label},nodeValue:function(){return this.defaultProps.value},range:function(){return this.options}},watch:{value:function(t){0!=this.options.length&&this.initData()},options:function(t){this.initData()}},created:function(){0!=this.options.length&&this.initData()},methods:{initData:function(){var t,e,n=this,i=this.value||"",r=this.range,u=[0];this.defaultType==this.nodeValue?(t=r.find((function(t){return t[n.nodeValue]==i})),e=r.findIndex((function(t){return t[n.nodeValue]==i}))):(t=r.find((function(t){return t[n.nodeKey]==i})),e=r.findIndex((function(t){return t[n.nodeKey]==i}))),u=[-1!=e?e:0],this.$nextTick((function(){n.pickVal=u})),this.defaultType==this.nodeValue?this.$emit("change",{result:t?t[this.nodeKey]:r[0][this.nodeKey],value:i||r[0][this.nodeKey],obj:t||r[0]}):this.$emit("change",{result:i||r[0][this.nodeKey],value:t?t[this.nodeValue]:r[0][this.nodeValue],obj:t||r[0]})},handlerChange:function(t){var e=this,n=i(t.detail.value),r=[n[0]||0],u=this.range,a=u[n[0]];this.$nextTick((function(){e.pickVal=r})),this.$emit("change",{result:a[this.nodeKey],value:a[this.nodeValue],obj:a})}}};e.default=f},"8eef":function(t,e,n){"use strict";var i;n.d(e,"b",(function(){return r})),n.d(e,"c",(function(){return u})),n.d(e,"a",(function(){return i}));var r=function(){var t=this,e=t.$createElement;t._self._c},u=[]},b66b:function(t,e,n){},bee2:function(t,e,n){"use strict";n.r(e);var i=n("753f"),r=n.n(i);for(var u in i)["default"].indexOf(u)<0&&function(t){n.d(e,t,(function(){return i[t]}))}(u);e["default"]=r.a}}]);
  2. ;(global["webpackJsonp"] = global["webpackJsonp"] || []).push([
  3. 'components/w-picker/selector-picker-create-component',
  4. {
  5. 'components/w-picker/selector-picker-create-component':(function(module, exports, __webpack_require__){
  6. __webpack_require__('934e')['createComponent'](__webpack_require__("08b8"))
  7. })
  8. },
  9. [['components/w-picker/selector-picker-create-component']]
  10. ]);