vantExt.js 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817
  1. (function webpackUniversalModuleDefinition(root, factory) {
  2. if(typeof exports === 'object' && typeof module === 'object')
  3. module.exports = factory();
  4. else if(typeof define === 'function' && define.amd)
  5. define("vantExt", [], factory);
  6. else if(typeof exports === 'object')
  7. exports["vantExt"] = factory();
  8. else
  9. root["vantExt"] = factory();
  10. })(typeof self !== 'undefined' ? self : this, function() {
  11. return /******/ (function(modules) { // webpackBootstrap
  12. /******/ // The module cache
  13. /******/ var installedModules = {};
  14. /******/
  15. /******/ // The require function
  16. /******/ function __webpack_require__(moduleId) {
  17. /******/
  18. /******/ // Check if module is in cache
  19. /******/ if(installedModules[moduleId]) {
  20. /******/ return installedModules[moduleId].exports;
  21. /******/ }
  22. /******/ // Create a new module (and put it into the cache)
  23. /******/ var module = installedModules[moduleId] = {
  24. /******/ i: moduleId,
  25. /******/ l: false,
  26. /******/ exports: {}
  27. /******/ };
  28. /******/
  29. /******/ // Execute the module function
  30. /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  31. /******/
  32. /******/ // Flag the module as loaded
  33. /******/ module.l = true;
  34. /******/
  35. /******/ // Return the exports of the module
  36. /******/ return module.exports;
  37. /******/ }
  38. /******/
  39. /******/
  40. /******/ // expose the modules object (__webpack_modules__)
  41. /******/ __webpack_require__.m = modules;
  42. /******/
  43. /******/ // expose the module cache
  44. /******/ __webpack_require__.c = installedModules;
  45. /******/
  46. /******/ // define getter function for harmony exports
  47. /******/ __webpack_require__.d = function(exports, name, getter) {
  48. /******/ if(!__webpack_require__.o(exports, name)) {
  49. /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
  50. /******/ }
  51. /******/ };
  52. /******/
  53. /******/ // define __esModule on exports
  54. /******/ __webpack_require__.r = function(exports) {
  55. /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
  56. /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
  57. /******/ }
  58. /******/ Object.defineProperty(exports, '__esModule', { value: true });
  59. /******/ };
  60. /******/
  61. /******/ // create a fake namespace object
  62. /******/ // mode & 1: value is a module id, require it
  63. /******/ // mode & 2: merge all properties of value into the ns
  64. /******/ // mode & 4: return value when already ns object
  65. /******/ // mode & 8|1: behave like require
  66. /******/ __webpack_require__.t = function(value, mode) {
  67. /******/ if(mode & 1) value = __webpack_require__(value);
  68. /******/ if(mode & 8) return value;
  69. /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
  70. /******/ var ns = Object.create(null);
  71. /******/ __webpack_require__.r(ns);
  72. /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
  73. /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
  74. /******/ return ns;
  75. /******/ };
  76. /******/
  77. /******/ // getDefaultExport function for compatibility with non-harmony modules
  78. /******/ __webpack_require__.n = function(module) {
  79. /******/ var getter = module && module.__esModule ?
  80. /******/ function getDefault() { return module['default']; } :
  81. /******/ function getModuleExports() { return module; };
  82. /******/ __webpack_require__.d(getter, 'a', getter);
  83. /******/ return getter;
  84. /******/ };
  85. /******/
  86. /******/ // Object.prototype.hasOwnProperty.call
  87. /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
  88. /******/
  89. /******/ // __webpack_public_path__
  90. /******/ __webpack_require__.p = "";
  91. /******/
  92. /******/
  93. /******/ // Load entry module and return exports
  94. /******/ return __webpack_require__(__webpack_require__.s = 4);
  95. /******/ })
  96. /************************************************************************/
  97. /******/ ([
  98. /* 0 */
  99. /***/ (function(module, exports, __webpack_require__) {
  100. var api = __webpack_require__(1);
  101. var content = __webpack_require__(2);
  102. content = content.__esModule ? content.default : content;
  103. if (typeof content === 'string') {
  104. content = [[module.i, content, '']];
  105. }
  106. var options = {};
  107. options.insert = "head";
  108. options.singleton = false;
  109. var update = api(content, options);
  110. module.exports = content.locals || {};
  111. /***/ }),
  112. /* 1 */
  113. /***/ (function(module, exports, __webpack_require__) {
  114. "use strict";
  115. var isOldIE = function isOldIE() {
  116. var memo;
  117. return function memorize() {
  118. if (typeof memo === 'undefined') {
  119. // Test for IE <= 9 as proposed by Browserhacks
  120. // @see http://browserhacks.com/#hack-e71d8692f65334173fee715c222cb805
  121. // Tests for existence of standard globals is to allow style-loader
  122. // to operate correctly into non-standard environments
  123. // @see https://github.com/webpack-contrib/style-loader/issues/177
  124. memo = Boolean(window && document && document.all && !window.atob);
  125. }
  126. return memo;
  127. };
  128. }();
  129. var getTarget = function getTarget() {
  130. var memo = {};
  131. return function memorize(target) {
  132. if (typeof memo[target] === 'undefined') {
  133. var styleTarget = document.querySelector(target); // Special case to return head of iframe instead of iframe itself
  134. if (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) {
  135. try {
  136. // This will throw an exception if access to iframe is blocked
  137. // due to cross-origin restrictions
  138. styleTarget = styleTarget.contentDocument.head;
  139. } catch (e) {
  140. // istanbul ignore next
  141. styleTarget = null;
  142. }
  143. }
  144. memo[target] = styleTarget;
  145. }
  146. return memo[target];
  147. };
  148. }();
  149. var stylesInDom = [];
  150. function getIndexByIdentifier(identifier) {
  151. var result = -1;
  152. for (var i = 0; i < stylesInDom.length; i++) {
  153. if (stylesInDom[i].identifier === identifier) {
  154. result = i;
  155. break;
  156. }
  157. }
  158. return result;
  159. }
  160. function modulesToDom(list, options) {
  161. var idCountMap = {};
  162. var identifiers = [];
  163. for (var i = 0; i < list.length; i++) {
  164. var item = list[i];
  165. var id = options.base ? item[0] + options.base : item[0];
  166. var count = idCountMap[id] || 0;
  167. var identifier = "".concat(id, " ").concat(count);
  168. idCountMap[id] = count + 1;
  169. var index = getIndexByIdentifier(identifier);
  170. var obj = {
  171. css: item[1],
  172. media: item[2],
  173. sourceMap: item[3]
  174. };
  175. if (index !== -1) {
  176. stylesInDom[index].references++;
  177. stylesInDom[index].updater(obj);
  178. } else {
  179. stylesInDom.push({
  180. identifier: identifier,
  181. updater: addStyle(obj, options),
  182. references: 1
  183. });
  184. }
  185. identifiers.push(identifier);
  186. }
  187. return identifiers;
  188. }
  189. function insertStyleElement(options) {
  190. var style = document.createElement('style');
  191. var attributes = options.attributes || {};
  192. if (typeof attributes.nonce === 'undefined') {
  193. var nonce = true ? __webpack_require__.nc : undefined;
  194. if (nonce) {
  195. attributes.nonce = nonce;
  196. }
  197. }
  198. Object.keys(attributes).forEach(function (key) {
  199. style.setAttribute(key, attributes[key]);
  200. });
  201. if (typeof options.insert === 'function') {
  202. options.insert(style);
  203. } else {
  204. var target = getTarget(options.insert || 'head');
  205. if (!target) {
  206. throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");
  207. }
  208. target.appendChild(style);
  209. }
  210. return style;
  211. }
  212. function removeStyleElement(style) {
  213. // istanbul ignore if
  214. if (style.parentNode === null) {
  215. return false;
  216. }
  217. style.parentNode.removeChild(style);
  218. }
  219. /* istanbul ignore next */
  220. var replaceText = function replaceText() {
  221. var textStore = [];
  222. return function replace(index, replacement) {
  223. textStore[index] = replacement;
  224. return textStore.filter(Boolean).join('\n');
  225. };
  226. }();
  227. function applyToSingletonTag(style, index, remove, obj) {
  228. var css = remove ? '' : obj.media ? "@media ".concat(obj.media, " {").concat(obj.css, "}") : obj.css; // For old IE
  229. /* istanbul ignore if */
  230. if (style.styleSheet) {
  231. style.styleSheet.cssText = replaceText(index, css);
  232. } else {
  233. var cssNode = document.createTextNode(css);
  234. var childNodes = style.childNodes;
  235. if (childNodes[index]) {
  236. style.removeChild(childNodes[index]);
  237. }
  238. if (childNodes.length) {
  239. style.insertBefore(cssNode, childNodes[index]);
  240. } else {
  241. style.appendChild(cssNode);
  242. }
  243. }
  244. }
  245. function applyToTag(style, options, obj) {
  246. var css = obj.css;
  247. var media = obj.media;
  248. var sourceMap = obj.sourceMap;
  249. if (media) {
  250. style.setAttribute('media', media);
  251. } else {
  252. style.removeAttribute('media');
  253. }
  254. if (sourceMap && btoa) {
  255. css += "\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))), " */");
  256. } // For old IE
  257. /* istanbul ignore if */
  258. if (style.styleSheet) {
  259. style.styleSheet.cssText = css;
  260. } else {
  261. while (style.firstChild) {
  262. style.removeChild(style.firstChild);
  263. }
  264. style.appendChild(document.createTextNode(css));
  265. }
  266. }
  267. var singleton = null;
  268. var singletonCounter = 0;
  269. function addStyle(obj, options) {
  270. var style;
  271. var update;
  272. var remove;
  273. if (options.singleton) {
  274. var styleIndex = singletonCounter++;
  275. style = singleton || (singleton = insertStyleElement(options));
  276. update = applyToSingletonTag.bind(null, style, styleIndex, false);
  277. remove = applyToSingletonTag.bind(null, style, styleIndex, true);
  278. } else {
  279. style = insertStyleElement(options);
  280. update = applyToTag.bind(null, style, options);
  281. remove = function remove() {
  282. removeStyleElement(style);
  283. };
  284. }
  285. update(obj);
  286. return function updateStyle(newObj) {
  287. if (newObj) {
  288. if (newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap) {
  289. return;
  290. }
  291. update(obj = newObj);
  292. } else {
  293. remove();
  294. }
  295. };
  296. }
  297. module.exports = function (list, options) {
  298. options = options || {}; // Force single-tag solution on IE6-9, which has a hard limit on the # of <style>
  299. // tags it will allow on a page
  300. if (!options.singleton && typeof options.singleton !== 'boolean') {
  301. options.singleton = isOldIE();
  302. }
  303. list = list || [];
  304. var lastIdentifiers = modulesToDom(list, options);
  305. return function update(newList) {
  306. newList = newList || [];
  307. if (Object.prototype.toString.call(newList) !== '[object Array]') {
  308. return;
  309. }
  310. for (var i = 0; i < lastIdentifiers.length; i++) {
  311. var identifier = lastIdentifiers[i];
  312. var index = getIndexByIdentifier(identifier);
  313. stylesInDom[index].references--;
  314. }
  315. var newLastIdentifiers = modulesToDom(newList, options);
  316. for (var _i = 0; _i < lastIdentifiers.length; _i++) {
  317. var _identifier = lastIdentifiers[_i];
  318. var _index = getIndexByIdentifier(_identifier);
  319. if (stylesInDom[_index].references === 0) {
  320. stylesInDom[_index].updater();
  321. stylesInDom.splice(_index, 1);
  322. }
  323. }
  324. lastIdentifiers = newLastIdentifiers;
  325. };
  326. };
  327. /***/ }),
  328. /* 2 */
  329. /***/ (function(module, exports, __webpack_require__) {
  330. // Imports
  331. var ___CSS_LOADER_API_IMPORT___ = __webpack_require__(3);
  332. exports = ___CSS_LOADER_API_IMPORT___(false);
  333. // Module
  334. exports.push([module.i, ".demo-button{min-width:120px;color:#fff;font-size:16px;line-height:36px;background-color:#f44;border:none;border-radius:30px}", ""]);
  335. // Exports
  336. module.exports = exports;
  337. /***/ }),
  338. /* 3 */
  339. /***/ (function(module, exports, __webpack_require__) {
  340. "use strict";
  341. /*
  342. MIT License http://www.opensource.org/licenses/mit-license.php
  343. Author Tobias Koppers @sokra
  344. */
  345. // css base code, injected by the css-loader
  346. // eslint-disable-next-line func-names
  347. module.exports = function (useSourceMap) {
  348. var list = []; // return the list of modules as css string
  349. list.toString = function toString() {
  350. return this.map(function (item) {
  351. var content = cssWithMappingToString(item, useSourceMap);
  352. if (item[2]) {
  353. return "@media ".concat(item[2], " {").concat(content, "}");
  354. }
  355. return content;
  356. }).join('');
  357. }; // import a list of modules into the list
  358. // eslint-disable-next-line func-names
  359. list.i = function (modules, mediaQuery, dedupe) {
  360. if (typeof modules === 'string') {
  361. // eslint-disable-next-line no-param-reassign
  362. modules = [[null, modules, '']];
  363. }
  364. var alreadyImportedModules = {};
  365. if (dedupe) {
  366. for (var i = 0; i < this.length; i++) {
  367. // eslint-disable-next-line prefer-destructuring
  368. var id = this[i][0];
  369. if (id != null) {
  370. alreadyImportedModules[id] = true;
  371. }
  372. }
  373. }
  374. for (var _i = 0; _i < modules.length; _i++) {
  375. var item = [].concat(modules[_i]);
  376. if (dedupe && alreadyImportedModules[item[0]]) {
  377. // eslint-disable-next-line no-continue
  378. continue;
  379. }
  380. if (mediaQuery) {
  381. if (!item[2]) {
  382. item[2] = mediaQuery;
  383. } else {
  384. item[2] = "".concat(mediaQuery, " and ").concat(item[2]);
  385. }
  386. }
  387. list.push(item);
  388. }
  389. };
  390. return list;
  391. };
  392. function cssWithMappingToString(item, useSourceMap) {
  393. var content = item[1] || ''; // eslint-disable-next-line prefer-destructuring
  394. var cssMapping = item[3];
  395. if (!cssMapping) {
  396. return content;
  397. }
  398. if (useSourceMap && typeof btoa === 'function') {
  399. var sourceMapping = toComment(cssMapping);
  400. var sourceURLs = cssMapping.sources.map(function (source) {
  401. return "/*# sourceURL=".concat(cssMapping.sourceRoot || '').concat(source, " */");
  402. });
  403. return [content].concat(sourceURLs).concat([sourceMapping]).join('\n');
  404. }
  405. return [content].join('\n');
  406. } // Adapted from convert-source-map (MIT)
  407. function toComment(sourceMap) {
  408. // eslint-disable-next-line no-undef
  409. var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));
  410. var data = "sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(base64);
  411. return "/*# ".concat(data, " */");
  412. }
  413. /***/ }),
  414. /* 4 */
  415. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  416. "use strict";
  417. // ESM COMPAT FLAG
  418. __webpack_require__.r(__webpack_exports__);
  419. // EXPORTS
  420. __webpack_require__.d(__webpack_exports__, "install", function() { return /* binding */ install; });
  421. __webpack_require__.d(__webpack_exports__, "version", function() { return /* binding */ version; });
  422. __webpack_require__.d(__webpack_exports__, "DemoButton", function() { return /* reexport */ demo_button; });
  423. __webpack_require__.d(__webpack_exports__, "IndexList", function() { return /* reexport */ index_list; });
  424. __webpack_require__.d(__webpack_exports__, "SvgIcon", function() { return /* reexport */ svg_icon; });
  425. // EXTERNAL MODULE: ./es/demo-button/index-sfc.css
  426. var index_sfc = __webpack_require__(0);
  427. // CONCATENATED MODULE: ./es/demo-button/index.js
  428. var __vue_render__ = function __vue_render__() {
  429. var _vm = this;
  430. var _h = _vm.$createElement;
  431. var _c = _vm._self._c || _h;
  432. return _c('button', {
  433. staticClass: "demo-button"
  434. }, [_vm._t("default")], 2);
  435. };
  436. var __vue_staticRenderFns__ = [];
  437. /* harmony default export */ var demo_button = ({
  438. render: __vue_render__,
  439. staticRenderFns: __vue_staticRenderFns__,
  440. name: 'demo-button',
  441. props: {
  442. color: String,
  443. type: {
  444. type: String,
  445. default: 'primary'
  446. }
  447. }
  448. });
  449. // CONCATENATED MODULE: ./es/index-list/index.js
  450. var INDICATOR_INDURATION = 1000;
  451. var TITLE_HEIGHT = 30;
  452. var index_list_vue_render_ = function __vue_render__() {
  453. var _vm = this;
  454. var _h = _vm.$createElement;
  455. var _c = _vm._self._c || _h;
  456. return _c('div', {
  457. staticClass: "index-list"
  458. }, [_c('ul', {
  459. ref: "indexWrap",
  460. staticClass: "index-list-wrap",
  461. on: {
  462. "scroll": _vm.onListWrapScroll
  463. }
  464. }, _vm._l(_vm.data, function (group, index) {
  465. return _c('li', {
  466. key: index,
  467. ref: "indexGroup",
  468. refInFor: true,
  469. staticClass: "index-group"
  470. }, [_c('h3', {
  471. staticClass: "index-group-title"
  472. }, [_vm._v(_vm._s(group.title))]), _vm._v(" "), _c('ul', _vm._l(group.items, function (item, index) {
  473. return _c('li', {
  474. key: index,
  475. staticClass: "index-group-item",
  476. on: {
  477. "click": function click($event) {
  478. return _vm.clickItem(item);
  479. }
  480. }
  481. }, [_vm._t("default", null, {
  482. "item": item
  483. })], 2);
  484. }), 0)]);
  485. }), 0), _vm._v(" "), _c('div', {
  486. staticClass: "index-nav"
  487. }, [_c('ul', _vm._l(_vm.indexList, function (item, index) {
  488. return _c('li', {
  489. key: index,
  490. staticClass: "nav-item",
  491. class: {
  492. 'active': _vm.currentIndex === index
  493. },
  494. attrs: {
  495. "data-index": index
  496. },
  497. on: {
  498. "touchstart": function touchstart($event) {
  499. $event.preventDefault();
  500. return _vm._onTouchStartIndex(index);
  501. }
  502. }
  503. }, [_vm._v(_vm._s(item))]);
  504. }), 0)]), _vm._v(" "), _c('transition', {
  505. attrs: {
  506. "name": "fade"
  507. }
  508. }, [_c('div', {
  509. directives: [{
  510. name: "show",
  511. rawName: "v-show",
  512. value: _vm.moving,
  513. expression: "moving"
  514. }],
  515. staticClass: "index-indicator"
  516. }, [_vm._v(_vm._s(_vm.currentIndicator))])])], 1);
  517. };
  518. var index_list_vue_staticRenderFns_ = [];
  519. /* harmony default export */ var index_list = ({
  520. render: index_list_vue_render_,
  521. staticRenderFns: index_list_vue_staticRenderFns_,
  522. name: "van-index-list",
  523. props: {
  524. data: {
  525. type: Array,
  526. default: function _default() {
  527. return [];
  528. }
  529. }
  530. },
  531. data: function data() {
  532. return {
  533. currentIndex: 0,
  534. moving: false,
  535. currentIndicator: ''
  536. };
  537. },
  538. watch: {
  539. currentIndex: function currentIndex(newVal) {
  540. var _this = this;
  541. clearTimeout(this.timer);
  542. this.currentIndicator = this.indexList[this.currentIndex];
  543. this.moving = true;
  544. this.timer = setTimeout(function () {
  545. _this.moving = false;
  546. }, INDICATOR_INDURATION);
  547. }
  548. },
  549. computed: {
  550. indexList: function indexList() {
  551. return this.data.map(function (group) {
  552. return group.title.substring(0, 1);
  553. });
  554. }
  555. },
  556. created: function created() {
  557. this.listHeight = [];
  558. this.timer = null;
  559. this.scrollTimer = null;
  560. },
  561. mounted: function mounted() {
  562. var _this2 = this;
  563. setTimeout(function () {
  564. _this2._calculateHeight();
  565. }, 20);
  566. },
  567. methods: {
  568. _calculateHeight: function _calculateHeight() {
  569. this.listHeight = [];
  570. var list = this.$refs.indexGroup;
  571. var height = 0;
  572. this.listHeight.push(height);
  573. for (var i = 0; i < list.length; i++) {
  574. var item = list[i];
  575. height += item.clientHeight;
  576. this.listHeight.push(height);
  577. }
  578. },
  579. _onTouchStartIndex: function _onTouchStartIndex(index) {
  580. this.currentIndex = index;
  581. this.$refs.indexWrap.scrollTop = this.listHeight[index];
  582. },
  583. clickItem: function clickItem(item) {
  584. this.$emit('choose', item);
  585. },
  586. onListWrapScroll: function onListWrapScroll(e) {
  587. var _this3 = this;
  588. clearTimeout(this.scrollTimer);
  589. this.scrollTimer = setTimeout(function () {
  590. var scrollTop = _this3.$refs.indexWrap.scrollTop;
  591. var listHeight = _this3.listHeight;
  592. for (var i = 0; i < listHeight.length - 1; i++) {
  593. if (scrollTop <= listHeight[i + 1] - TITLE_HEIGHT && scrollTop >= listHeight[i]) {
  594. _this3.currentIndex = i;
  595. return;
  596. }
  597. }
  598. }, 20);
  599. },
  600. scrollToByTitle: function scrollToByTitle(title) {
  601. var indexList = this.indexList;
  602. for (var i = 0; i < indexList.length; i++) {
  603. if (indexList[i] == title) {
  604. this._onTouchStartIndex(i);
  605. }
  606. }
  607. },
  608. scrollToY: function scrollToY(y) {
  609. this.$refs.indexWrap.scrollTop = y;
  610. },
  611. scrollToTop: function scrollToTop() {
  612. this.$refs.indexWrap.scrollTop = 0;
  613. },
  614. scrollToBottom: function scrollToBottom() {
  615. this.$refs.indexWrap.scrollTop = this.$refs.indexWrap.scrollHeight;
  616. }
  617. },
  618. destroyed: function destroyed() {
  619. clearTimeout(this.timer);
  620. clearTimeout(this.scrollTimer);
  621. }
  622. });
  623. // CONCATENATED MODULE: ./es/svg-icon/index.js
  624. var svg_icon_vue_render_ = function __vue_render__() {
  625. var _vm = this;
  626. var _h = _vm.$createElement;
  627. var _c = _vm._self._c || _h;
  628. return _c('span', [_c('svg', {
  629. class: _vm.svgClass,
  630. attrs: {
  631. "aria-hidden": "true"
  632. }
  633. }, [_c('use', {
  634. attrs: {
  635. "xlink:href": _vm.iconName
  636. }
  637. })])]);
  638. };
  639. var svg_icon_vue_staticRenderFns_ = [];
  640. /* harmony default export */ var svg_icon = ({
  641. render: svg_icon_vue_render_,
  642. staticRenderFns: svg_icon_vue_staticRenderFns_,
  643. name: "van-svg-icon",
  644. props: {
  645. iconClass: {
  646. type: String,
  647. required: true
  648. },
  649. className: {
  650. type: String,
  651. default: ""
  652. }
  653. },
  654. computed: {
  655. iconName: function iconName() {
  656. return "#icon-" + this.iconClass;
  657. },
  658. svgClass: function svgClass() {
  659. if (this.className) {
  660. return "svg-icon " + this.className;
  661. } else {
  662. return "svg-icon";
  663. }
  664. }
  665. }
  666. });
  667. // CONCATENATED MODULE: ./es/index.js
  668. var version = '1.0.0';
  669. function install(Vue) {
  670. var components = [demo_button, index_list, svg_icon];
  671. components.forEach(function (item) {
  672. if (item.install) {
  673. Vue.use(item);
  674. } else if (item.name) {
  675. Vue.component(item.name, item);
  676. }
  677. });
  678. }
  679. if (typeof window !== 'undefined' && window.Vue) {
  680. install(window.Vue);
  681. }
  682. /* harmony default export */ var es = __webpack_exports__["default"] = ({
  683. install: install,
  684. version: version
  685. });
  686. /***/ })
  687. /******/ ]);
  688. });