74.d2184ed7.js 7.3 KB

1
  1. (window.webpackJsonp=window.webpackJsonp||[]).push([[74],{780:function(e,t,s){"use strict";s.r(t);var a=s(41),r=Object(a.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h1",{attrs:{id:"faq"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#faq"}},[e._v("#")]),e._v(" FAQ")]),e._v(" "),t("h3",{attrs:{id:"why-can-t-betterscroll-scroll-is-failed-when-initialization"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#why-can-t-betterscroll-scroll-is-failed-when-initialization"}},[e._v("#")]),e._v(" Why can't BetterScroll scroll is failed when initialization?")]),e._v(" "),t("p",[e._v("BetterScroll scrolling principle is that the height/width of the "),t("code",[e._v("content")]),e._v(" element exceeds the height/width of the "),t("code",[e._v("wrapper")]),e._v(" element. Also, if your content element contains images of a non-fixed size, you must call the "),t("code",[e._v("refresh()")]),e._v(" method to ensure that the height is calculated correctly after the image has been loaded. There is also a situation where the form element exists on the page. After the keyboard is popped up, the palatable height of the page is compressed, causing "),t("code",[e._v("bs")]),e._v(" to not work properly, and the "),t("code",[e._v("refresh()")]),e._v(" method is still need to be called.")]),e._v(" "),t("h3",{attrs:{id:"why-can-t-the-click-event-in-the-betterscroll-area-be-triggered"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#why-can-t-the-click-event-in-the-betterscroll-area-be-triggered"}},[e._v("#")]),e._v(" Why can't the click event in the BetterScroll area be triggered?")]),e._v(" "),t("p",[e._v("By default, BetterScroll blocks the browser's native click event. If you want the click event to take effect, BetterScroll dispatches a click event and the "),t("code",[e._v("_constructed")]),e._v(" of the event parameter is true. The configuration items are as follows:")]),e._v(" "),t("div",{staticClass:"language-js extra-class"},[t("pre",{pre:!0,attrs:{class:"language-js"}},[t("code",[t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("import")]),e._v(" BScroll "),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("from")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[e._v("'@better-scroll/core'")]),e._v("\n\n"),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("let")]),e._v(" bs "),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("new")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token class-name"}},[e._v("BScroll")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token string"}},[e._v("'./div'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token literal-property property"}},[e._v("click")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token boolean"}},[e._v("true")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),e._v("\n")])])]),t("h3",{attrs:{id:"why-does-my-betterscroll-listen-for-the-scroll-hook-and-the-listener-doesn-t-execute"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#why-does-my-betterscroll-listen-for-the-scroll-hook-and-the-listener-doesn-t-execute"}},[e._v("#")]),e._v(" Why does my BetterScroll listen for the "),t("code",[e._v("scroll")]),e._v(" hook and the listener doesn't execute?")]),e._v(" "),t("p",[e._v("BetterScroll uses the "),t("code",[e._v("probeType")]),e._v(" configuration item to decide whether to dispatch the "),t("code",[e._v("scroll")]),e._v(" hook because there is some performance penalty. When the "),t("code",[e._v("probeType")]),e._v(" is "),t("code",[e._v("2")]),e._v(", the event will be dispatched in real time. When the "),t("code",[e._v("probeType")]),e._v(" is "),t("code",[e._v("3")]),e._v(", the event will be dispatched during the "),t("code",[e._v("momentum")]),e._v(" animation. The recommended setting is "),t("code",[e._v("3")]),e._v(".")]),e._v(" "),t("div",{staticClass:"language-js extra-class"},[t("pre",{pre:!0,attrs:{class:"language-js"}},[t("code",[t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("import")]),e._v(" BScroll "),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("from")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[e._v("'@better-scroll/core'")]),e._v("\n\n"),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("let")]),e._v(" bs "),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("new")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token class-name"}},[e._v("BScroll")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token string"}},[e._v("'./div'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token literal-property property"}},[e._v("probeType")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token number"}},[e._v("3")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),e._v("\n")])])]),t("h3",{attrs:{id:"slide-used-horizontal-scrolling-found-that-vertical-scrolling-in-the-slide-area-is-invalid"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#slide-used-horizontal-scrolling-found-that-vertical-scrolling-in-the-slide-area-is-invalid"}},[e._v("#")]),e._v(" Slide used horizontal scrolling, found that vertical scrolling in the slide area is invalid?")]),e._v(" "),t("p",[e._v("If you want to keep your browser's native vertical scrolling, you need the following configuration items:")]),e._v(" "),t("div",{staticClass:"language-js extra-class"},[t("pre",{pre:!0,attrs:{class:"language-js"}},[t("code",[t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("import")]),e._v(" BScroll "),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("from")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[e._v("'@better-scroll/core'")]),e._v("\n\n"),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("let")]),e._v(" bs "),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("new")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token class-name"}},[e._v("BScroll")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token string"}},[e._v("'./div'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token literal-property property"}},[e._v("eventPassthrough")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[e._v("'vertical'")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),e._v("\n")])])])])}),[],!1,null,null,null);t.default=r.exports}}]);