nutui-by-zchuhyy
Version:
一套轻量级移动端Vue组件库
7 lines • 4.09 kB
JavaScript
/*!
* nutui-by-zchuhyy v0.0.16 - fixednav.js, 7c15ab32fbfb9d26339f, Wed Mar 17 2021 16:52:20 GMT+0800 (GMT+08:00)
* (c) 2017-2020 JDC
* Released under the MIT License.
*/
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("fixednav",[],e):"object"==typeof exports?exports.fixednav=e():t.fixednav=e()}("undefined"!=typeof self?self:this,(function(){return function(t){var e={};function n(i){if(e[i])return e[i].exports;var o=e[i]={i:i,l:!1,exports:{}};return t[i].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(i,o,function(e){return t[e]}.bind(null,o));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="./",n(n.s=201)}({0:function(t,e,n){"use strict";function i(t,e,n,i,o,r,u,a){var c,f="function"==typeof t?t.options:t;if(e&&(f.render=e,f.staticRenderFns=n,f._compiled=!0),i&&(f.functional=!0),r&&(f._scopeId="data-v-"+r),u?(c=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),o&&o.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(u)},f._ssrRegister=c):o&&(c=a?function(){o.call(this,(f.functional?this.parent:this).$root.$options.shadowRoot)}:o),c)if(f.functional){f._injectStyles=c;var s=f.render;f.render=function(t,e){return c.call(e),s(t,e)}}else{var l=f.beforeCreate;f.beforeCreate=l?[].concat(l,c):[c]}return{exports:t,options:f}}n.d(e,"a",(function(){return i}))},145:function(t,e,n){},201:function(t,e,n){"use strict";n.r(e);var i=n(3),o=n.n(i),r={name:"nut-fixednav",props:{active:{type:Boolean,default:!1},navList:{default:function(){return[]},type:Array},activeText:{default:"收起导航",type:String},unActiveText:{default:"快速导航",type:String},type:{default:"right",type:String}},computed:{styled:function(){return o()({active:this.defaultActive},this.defaultType,!0)}},watch:{defaultActive:function(t,e){this.$emit("update:active",t)}},data:function(){return{defaultActive:!1,defaultType:""}},mounted:function(){this.defaultActive=this.active,this.defaultType=this.type},methods:{selected:function(t,e){this.$emit("selected",{item:t,$event:e})}}},u=n(0),a=Object(u.a)(r,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"nut-fixednav",class:t.styled},[n("div",{staticStyle:{position:"relative","z-index":"1"}},[n("nut-popup",{model:{value:t.defaultActive,callback:function(e){t.defaultActive=e},expression:"defaultActive"}})],1),t._v(" "),t._t("list",[n("ul",{staticClass:"fixed-list"},t._l(t.navList,(function(e,i){return n("li",{key:e.id||i,on:{click:function(n){return t.selected(e,n)}}},[n("img",{attrs:{src:e.icon}}),t._v(" "),n("span",[t._v(t._s(e.text))]),t._v(" "),e.num?n("b",[t._v(t._s(e.num))]):t._e()])})),0)]),t._v(" "),n("div",{staticClass:"fixed-btn",on:{click:function(e){t.defaultActive=!t.defaultActive}}},[t._t("btn",[n("img",{attrs:{src:"https://img14.360buyimg.com/imagetools/jfs/t1/149975/30/1615/368/5ef86176Eb75bae46/5f70ae80a2d567b4.png"}}),t._v(" "),n("span",[t._v(t._s(t.defaultActive?t.activeText:t.unActiveText))])])],2)],2)}),[],!1,null,null,null).exports;n(145);a.install=function(t){t.component(a.name,a)};e.default=a},3:function(t,e){t.exports=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}}})}));
//# sourceMappingURL=fixednav.js.map