fix(Sku): scroll issue and add default picture (#6605)

Co-authored-by: 水墨 <laihuamin@youzan.com>
This commit is contained in:
来铧敏 2020-06-24 14:08:20 +08:00 committed by GitHub
parent 62cd251327
commit eb58e3cb74
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 4 deletions

View File

@ -2,7 +2,6 @@
import { createNamespace } from '../../utils'; import { createNamespace } from '../../utils';
import { BORDER_BOTTOM } from '../../utils/constant'; import { BORDER_BOTTOM } from '../../utils/constant';
import { BindEventMixin } from '../../mixins/bind-event'; import { BindEventMixin } from '../../mixins/bind-event';
import { getScroller } from '../../utils/dom/scroll';
const [createComponent, bem, t] = createNamespace('sku-row'); const [createComponent, bem, t] = createNamespace('sku-row');
@ -14,7 +13,7 @@ export default createComponent({
} }
if (!this.scrollCon) { if (!this.scrollCon) {
this.scrollCon = getScroller(this.$refs.skuContent); this.scrollCon = this.$refs.skuContent;
} }
bind(this.scrollCon, 'scroll', this.onScroll); bind(this.scrollCon, 'scroll', this.onScroll);
@ -60,7 +59,6 @@ export default createComponent({
}); });
}, },
}, },
mounted() {},
render() { render() {
const { skuRow, largePicturePreview, hasScrollTab } = this; const { skuRow, largePicturePreview, hasScrollTab } = this;
const multipleNode = skuRow.is_multiple && ( const multipleNode = skuRow.is_multiple && (

View File

@ -19,7 +19,11 @@ export default createComponent({
computed: { computed: {
imgUrl() { imgUrl() {
return this.skuValue.imgUrl || this.skuValue.img_url; const url = this.skuValue.imgUrl || this.skuValue.img_url;
return this.largePicturePreview
? url ||
'https://img.yzcdn.cn/upload_files/2020/06/24/FmKWDg0bN9rMcTp9ne8MXiQWGtLn.png'
: url;
}, },
choosable() { choosable() {

View File

@ -283,6 +283,7 @@
&__content { &__content {
overflow-x: scroll; overflow-x: scroll;
overflow-y: hidden;
-webkit-overflow-scrolling: touch; -webkit-overflow-scrolling: touch;
&::-webkit-scrollbar { &::-webkit-scrollbar {